mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-03 14:38:08 +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() {
|
static bool isLangUtf8() {
|
||||||
const char* lang = std::getenv("LANG");
|
const char* lang = std::getenv("LANG");
|
||||||
|
|
||||||
if (!lang) {
|
if (!lang) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string str = std::string(lang);
|
std::string str = std::string(lang);
|
||||||
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
|
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
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user