Merge branch 'dnso86-dnso86-patch-wc2mb' into hotfix-1.7.2

This commit is contained in:
Jinhao 2019-09-02 05:05:48 +08:00
commit 8cbadb70ff

View File

@ -246,7 +246,7 @@ namespace nana
if(bytes > 1) if(bytes > 1)
{ {
mbstr.resize(bytes - 1); mbstr.resize(bytes - 1);
::WideCharToMultiByte(CP_ACP, 0, s, -1, &(mbstr[0]), bytes - 1, 0, 0); ::WideCharToMultiByte(CP_ACP, 0, s, -1, &(mbstr[0]), bytes, 0, 0);
} }
return true; return true;
#else #else
@ -280,7 +280,7 @@ namespace nana
if(chars > 1) if(chars > 1)
{ {
wcstr.resize(chars - 1); wcstr.resize(chars - 1);
::MultiByteToWideChar(CP_ACP, 0, s, -1, &wcstr[0], chars - 1); ::MultiByteToWideChar(CP_ACP, 0, s, -1, &wcstr[0], chars);
} }
#else #else
locale_initializer::init(); locale_initializer::init();