fix non-utf locale 2
This commit is contained in:
parent
1e328f43f7
commit
1ad5224227
1 changed files with 3 additions and 3 deletions
|
@ -113,10 +113,10 @@ namespace console {
|
|||
}
|
||||
|
||||
auto locale = setlocale(LC_ALL, "");
|
||||
auto lang = getenv("LANG");
|
||||
|
||||
if (locale == nullptr) {
|
||||
if (lang != nullptr && strcmp(lang, "C") && strcasestr(lang, "utf-8")) {
|
||||
if (locale == nullptr || !strcmp(locale, "C") || strcasestr(locale, "utf-8") == nullptr) {
|
||||
auto lang = getenv("LANG");
|
||||
if (lang != nullptr && strcmp(lang, "C") && strcasestr(lang, "utf-8") != nullptr) {
|
||||
setlocale(LC_ALL, lang);
|
||||
} else{
|
||||
setlocale(LC_ALL, "C.UTF-8");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue