This commit is contained in:
Akash Mozumdar 2018-09-29 13:10:07 -04:00
parent 8cd4ea4a29
commit baa7923be2

View File

@ -31,7 +31,7 @@ namespace Host
inline std::wstring StringToWideString(const std::string& text, UINT encoding) inline std::wstring StringToWideString(const std::string& text, UINT encoding)
{ {
std::wstring ret(text.size(), 0); std::wstring ret(text.size() + 1, 0);
ret.resize(MultiByteToWideChar(encoding, 0, text.c_str(), -1, ret.data(), ret.capacity())); ret.resize(MultiByteToWideChar(encoding, 0, text.c_str(), -1, ret.data(), ret.capacity()));
return ret; return ret;
} }