Changeset 93647 in vbox for trunk/src/VBox
- Timestamp:
- Feb 8, 2022 9:05:38 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/Common/PasswordInput.cpp
r93115 r93647 23 23 24 24 #include <iprt/ctype.h> 25 #include <iprt/err.h> 25 26 #include <iprt/message.h> 26 27 #include <iprt/stream.h> … … 129 130 vrc = RTStrmGetLine(g_pStdIn, &aszPwdInput[0], sizeof(aszPwdInput)); 130 131 if (RT_SUCCESS(vrc)) 132 { 133 #ifdef RT_OS_WINDOWS 134 /* 135 * Returned string encoded in console code page (e.g. Win-125X or CP-XXX). 136 * Convert it to Utf-8 137 */ 138 char *pszPassword = NULL; 139 vrc = RTStrConsoleCPToUtf8(&pszPassword, aszPwdInput); 140 if (RT_SUCCESS(vrc) && pszPassword) 141 { 142 *pPassword = pszPassword; 143 RTMemFree(pszPassword); 144 } 145 else 146 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, 147 "Failed to convert password from windows console codepage to Utf-8 (%Rrc)", 148 vrc); 149 #else 131 150 *pPassword = aszPwdInput; 151 #endif 152 } 132 153 else 133 154 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed read password from command line (%Rrc)", vrc);
Note:
See TracChangeset
for help on using the changeset viewer.