1std::wstring s2ws(const std::string& str)
2{
3 int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);
4 std::wstring wstrTo( size_needed, 0 );
5 MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], size_needed);
6 return wstrTo;
7}
8