From 9ca75d71a92f72d76704f36dd729011174a430ae Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 3 Apr 2023 10:15:43 +0800 Subject: [PATCH] 1 --- src/common/string/stringutils.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/common/string/stringutils.cpp b/src/common/string/stringutils.cpp index ff4536c..ed3c2df 100644 --- a/src/common/string/stringutils.cpp +++ b/src/common/string/stringutils.cpp @@ -52,10 +52,15 @@ namespace behaviac { char* loc = setlocale(LC_ALL, locale); + #if 1 + mbstowcs(buffer, str.c_str(), dwNum); + ret = true; + #else if (loc) { mbstowcs(buffer, str.c_str(), dwNum); ret = true; } + #endif //restore setlocale(LC_ALL, currrentLocale); @@ -108,10 +113,16 @@ namespace behaviac { char* loc = setlocale(LC_ALL, locale); +#if 1 + wcstombs(buffer, wstr.c_str(), dwNum); + ret = true; + + #else if (loc) { wcstombs(buffer, wstr.c_str(), dwNum); ret = true; } + #endif //restore setlocale(LC_ALL, currrentLocale);