remove redundant C locale check
This commit is contained in:
parent
a72c053f0c
commit
8396208c00
1 changed files with 2 additions and 2 deletions
|
@ -114,9 +114,9 @@ namespace console {
|
||||||
|
|
||||||
auto locale = setlocale(LC_ALL, "");
|
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");
|
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);
|
setlocale(LC_ALL, lang);
|
||||||
} else {
|
} else {
|
||||||
setlocale(LC_ALL, "C.UTF-8");
|
setlocale(LC_ALL, "C.UTF-8");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue