From f55628de1951f00b488dfe9884f56251943589c9 Mon Sep 17 00:00:00 2001 From: casey langen Date: Mon, 24 Dec 2018 11:01:41 -0800 Subject: [PATCH] Improved UTF8 detection. --- src/musikcube/cursespp/App.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/musikcube/cursespp/App.cpp b/src/musikcube/cursespp/App.cpp index 2782691a4..026420467 100755 --- a/src/musikcube/cursespp/App.cpp +++ b/src/musikcube/cursespp/App.cpp @@ -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