remove redundant C locale check

This commit is contained in:
staviq 2023-10-20 05:15:40 +02:00
parent a72c053f0c
commit 8396208c00

View file

@ -114,9 +114,9 @@ namespace console {
auto locale = setlocale(LC_ALL, "");
if (locale == nullptr || !strcmp(locale, "C") || strcasestr(locale, "utf-8") == nullptr) {
if (locale == nullptr || strcasestr(locale, "utf-8") == nullptr) {
auto lang = getenv("LANG");
if (lang != nullptr && strcmp(lang, "C") && strcasestr(lang, "utf-8") != nullptr) {
if (lang != nullptr && strcasestr(lang, "utf-8") != nullptr) {
setlocale(LC_ALL, lang);
} else {
setlocale(LC_ALL, "C.UTF-8");