diff options
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -71,9 +71,9 @@ std::wstring s2ws(const std::string& s) { int len; int slength = (int)s.length() + 1; - len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0); + len = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), slength, 0, 0); wchar_t* buf = new wchar_t[len]; - MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len); + MultiByteToWideChar(CP_UTF8, 0, s.c_str(), slength, buf, len); std::wstring r(buf); delete[] buf; return r; @@ -84,9 +84,9 @@ std::string ws2s(const std::wstring& s) { int len; int slength = (int)s.length() + 1; - len = WideCharToMultiByte(CP_ACP, 0, s.c_str(), slength, 0, 0, 0, 0); + len = WideCharToMultiByte(CP_UTF8, 0, s.c_str(), slength, 0, 0, 0, 0); char* buf = new char[len]; - WideCharToMultiByte(CP_ACP, 0, s.c_str(), slength, buf, len, 0, 0); + WideCharToMultiByte(CP_UTF8, 0, s.c_str(), slength, buf, len, 0, 0); std::string r(buf); delete[] buf; return r; |