From 4f52cec03903e62b0ffc8c023dd422bfb680b154 Mon Sep 17 00:00:00 2001 From: alexxfxiao Date: Fri, 6 Jan 2023 17:08:08 +0800 Subject: [PATCH] =?UTF-8?q?[bugfix]=20=E5=A6=82=E6=9E=9C=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=B2=A1=E6=9C=89zh=5FCN.utf8=EF=BC=8C=E5=88=99hotUpdate?= =?UTF-8?q?=E4=BC=9A=E4=B8=8D=E5=B7=A5=E4=BD=9C=E3=80=82=E4=BF=AE=E6=94=B9?= =?UTF-8?q?MBSToWCS=E5=A6=82=E6=9E=9Csetlocale=E5=A4=B1=E8=B4=A5=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E4=BD=BF=E7=94=A8=E9=BB=98=E8=AE=A4=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E9=9B=86=E8=BD=AC=E6=8D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/string/stringutils.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/string/stringutils.cpp b/src/common/string/stringutils.cpp index ff4536c6..8f898323 100644 --- a/src/common/string/stringutils.cpp +++ b/src/common/string/stringutils.cpp @@ -52,8 +52,9 @@ namespace behaviac { char* loc = setlocale(LC_ALL, locale); + // if loc==null, use default charset + mbstowcs(buffer, str.c_str(), dwNum); if (loc) { - mbstowcs(buffer, str.c_str(), dwNum); ret = true; } @@ -108,8 +109,9 @@ namespace behaviac { char* loc = setlocale(LC_ALL, locale); + // if loc==null, use default charset + wcstombs(buffer, wstr.c_str(), dwNum); if (loc) { - wcstombs(buffer, wstr.c_str(), dwNum); ret = true; }