This commit is contained in:
aozhiwei 2023-04-03 10:15:43 +08:00
parent 98824e365b
commit 9ca75d71a9

View File

@ -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);