mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-01 00:19:20 +00:00
Improved UTF8 detection.
This commit is contained in:
parent
f329f3b4b6
commit
f55628de19
@ -78,12 +78,17 @@ static void resizedHandler(int signal) {
|
||||
|
||||
static bool isLangUtf8() {
|
||||
const char* lang = std::getenv("LANG");
|
||||
|
||||
if (!lang) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string str = std::string(lang);
|
||||
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
|
||||
return str.find("utf-8") != std::string::npos;
|
||||
|
||||
return
|
||||
str.find("utf-8") != std::string::npos ||
|
||||
str.find("utf8") != std::string::npos;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user