From 4c1c269f903f8c4bd5d24ff0df5a9cc7d9e19385 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 16 Mar 2025 11:51:32 +0100 Subject: [PATCH] The LANG and LANGUAGE variables are now set explicitly to the UTF-8 character encoding on Linux, macOS and Android --- es-core/src/utils/LocalizationUtil.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/es-core/src/utils/LocalizationUtil.cpp b/es-core/src/utils/LocalizationUtil.cpp index f986edb17..98b774b22 100644 --- a/es-core/src/utils/LocalizationUtil.cpp +++ b/es-core/src/utils/LocalizationUtil.cpp @@ -244,8 +244,8 @@ namespace Utils LOCALE_ALLOW_NEUTRAL_NAMES); SetThreadLocale(sLocaleID); #else - setenv("LANGUAGE", locale.c_str(), 1); - setenv("LANG", locale.c_str(), 1); + setenv("LANGUAGE", std::string {locale + ".UTF-8"}.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 // 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