fix by @defrag257

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

View file

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