fix by @defrag257

This commit is contained in:
Ivan Sorokin 2025-04-12 20:43:19 +03:00
parent b557f6f6e1
commit e60fa1f578

View file

@ -557,11 +557,14 @@ void CItem::GetUnicodeString(UString &res, const AString &s, bool isComment, boo
int tableLen = sizeof(lcToOemTable) / sizeof(lcToOemTable[0]);
int lcLen = 0, i;
// Detect required code page name from current locale
char *lc = setlocale(LC_CTYPE, "");
// Detect required code page name from current locale
char *lc = getenv("LC_ALL");
if (!lc || !lc[0]) {
lc = getenv("LC_CTYPE");
}
if (!lc || !lc[0]) {
lc = getenv("LANG");
}
if (lc && lc[0]) {
// Compare up to the dot, if it exists, e.g. en_US.UTF-8