From 1e328f43f76bb68e8b16381d725c02cbdf7c7c89 Mon Sep 17 00:00:00 2001 From: staviq Date: Fri, 20 Oct 2023 04:03:22 +0200 Subject: [PATCH] fix non-utf locale --- common/console.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/console.cpp b/common/console.cpp index 21c62924c..6046b1bfa 100644 --- a/common/console.cpp +++ b/common/console.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #endif #define ANSI_COLOR_RED "\x1b[31m" @@ -115,7 +116,7 @@ namespace console { auto lang = getenv("LANG"); if (locale == nullptr) { - if (lang != nullptr) { + if (lang != nullptr && strcmp(lang, "C") && strcasestr(lang, "utf-8")) { setlocale(LC_ALL, lang); } else{ setlocale(LC_ALL, "C.UTF-8");