Merge branch 'dnso86-patch-wc2mb' of https://github.com/dnso86/nana into dnso86-dnso86-patch-wc2mb

This commit is contained in:
Jinhao 2019-09-02 05:03:03 +08:00
commit fbeb8caf1f

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