fix getwchar failing when LC_ALL undefined
This commit is contained in:
parent
f3b25e4043
commit
9eab8b69dd
|
|
@ -111,7 +111,16 @@ namespace console {
|
|||
}
|
||||
}
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
auto locale = setlocale(LC_ALL, "");
|
||||
auto lang = getenv("LANG");
|
||||
|
||||
if (locale == nullptr) {
|
||||
if (lang != nullptr) {
|
||||
setlocale(LC_ALL, lang);
|
||||
} else{
|
||||
setlocale(LC_ALL, "C.UTF-8");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue