Don't use MB_PRECOMPOSED

This commit is contained in:
kaetemi 2019-05-09 04:45:48 +08:00
parent 4baccf2802
commit b7aa2a6999

View file

@ -170,7 +170,7 @@ std::wstring winCpToWide(const char *str, size_t len, UINT cp)
wchar_t *tmp = (wchar_t *)_malloca((len + 1) * 4); wchar_t *tmp = (wchar_t *)_malloca((len + 1) * 4);
if (!tmp) if (!tmp)
return std::wstring(); return std::wstring();
int tmpLen = MultiByteToWideChar(cp, MB_PRECOMPOSED, int tmpLen = MultiByteToWideChar(cp, 0,
str, (int)(len + 1), /* include null-termination */ str, (int)(len + 1), /* include null-termination */
tmp, (int)((len + 1) * 4)); tmp, (int)((len + 1) * 4));
if (tmpLen <= 1) if (tmpLen <= 1)