-
-
Save rightfold/274a24e3cf4a685edcf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
std::unique_ptr<wchar_t[]> buf(new wchar_t[len]); | |
MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf.get(), len); | |
std::wstring r(buf.get()); | |
return r; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment