Changeset 93543 in vbox for trunk/src/VBox
- Timestamp:
- Feb 2, 2022 12:40:40 PM (3 years ago)
- Location:
- trunk/src/VBox/Runtime/r3/posix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
r93487 r93543 1447 1447 } 1448 1448 else 1449 #ifdef RT_OS_DARWIN /* @bugref{10153}: Darwin defaults to UTF-8. */ 1450 pszEncoding = "UTF-8"; 1451 #else 1449 1452 pszEncoding = "ASCII"; 1453 #endif 1450 1454 } 1451 1455 -
trunk/src/VBox/Runtime/r3/posix/utf8-posix.cpp
r93115 r93543 40 40 #include <errno.h> 41 41 #include <locale.h> 42 #ifdef RT_OS_DARWIN 43 # include <stdlib.h> 44 #endif 42 45 43 46 /* iconv prototype changed with 165+ (thanks to PSARC/2010/160 Bugster 7037400) */ … … 107 110 DECLHIDDEN(const char *) rtStrGetLocaleCodeset(void) 108 111 { 112 #ifdef RT_OS_DARWIN 113 /* 114 * @bugref{10153}: If no locale specified in the environment (typically the 115 * case when launched via Finder, LaunchPad or similar) default to UTF-8. 116 */ 117 static int8_t volatile s_fIsUtf8 = -1; 118 int8_t fIsUtf8 = s_fIsUtf8; 119 if (fIsUtf8) 120 { 121 if (fIsUtf8 == true) 122 return "UTF-8"; 123 124 /* Initialize: */ 125 fIsUtf8 = true; 126 static const char * const s_papszVariables[] = { "LC_ALL", "LC_CTYPE", "LANG" }; 127 for (size_t i = 0; i < RT_ELEMENTS(s_papszVariables); i++) 128 { 129 const char *pszValue = getenv(s_papszVariables[i]); 130 if (pszValue && *pszValue) 131 { 132 fIsUtf8 = false; 133 break; 134 } 135 } 136 s_fIsUtf8 = fIsUtf8; 137 if (fIsUtf8 == true) 138 return "UTF-8"; 139 } 140 #endif 109 141 return nl_langinfo(CODESET); 110 142 }
Note:
See TracChangeset
for help on using the changeset viewer.