From f2ead3d3a9dbc78ada36a0b79068c6aa5c7023fd Mon Sep 17 00:00:00 2001 From: Laurent Cheylus Date: Thu, 8 Feb 2024 14:35:21 +0100 Subject: [PATCH] Check LC_CTYPE to set UTF-8 locale Fix aristocratos/btop#752 Signed-off-by: Laurent Cheylus --- src/btop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/btop.cpp b/src/btop.cpp index 736854f..864ecea 100644 --- a/src/btop.cpp +++ b/src/btop.cpp @@ -920,7 +920,7 @@ int main(int argc, char **argv) { else { string found; bool set_failure{}; - for (const auto loc_env : array{"LANG", "LC_ALL"}) { + for (const auto loc_env : array{"LANG", "LC_ALL", "LC_CTYPE"}) { if (std::getenv(loc_env) != nullptr and str_to_upper(s_replace((string)std::getenv(loc_env), "-", "")).ends_with("UTF8")) { found = std::getenv(loc_env); if (std::setlocale(LC_ALL, found.c_str()) == nullptr) {