The LANG and LANGUAGE variables are now set explicitly to the UTF-8 character encoding on Linux, macOS and Android

This commit is contained in:
Leon Styhre 2025-03-16 11:51:32 +01:00
parent a34657db1a
commit 4c1c269f90

View file

@ -244,8 +244,8 @@ namespace Utils
LOCALE_ALLOW_NEUTRAL_NAMES); LOCALE_ALLOW_NEUTRAL_NAMES);
SetThreadLocale(sLocaleID); SetThreadLocale(sLocaleID);
#else #else
setenv("LANGUAGE", locale.c_str(), 1); setenv("LANGUAGE", std::string {locale + ".UTF-8"}.c_str(), 1);
setenv("LANG", locale.c_str(), 1); setenv("LANG", std::string {locale + ".UTF-8"}.c_str(), 1);
// For some bizarre reason we need to first set the locale to en_US.UTF-8 before // For some bizarre reason we need to first set the locale to en_US.UTF-8 before
// we set it to the requested locale as some specific locales like pt_BR and zh_CN // we set it to the requested locale as some specific locales like pt_BR and zh_CN
// otherwise won't work consistently. This must be some kind of library or OS bug as // otherwise won't work consistently. This must be some kind of library or OS bug as