#include "util/win32/stringutils.hpp" using namespace std; #define WIN32_MEAN_AND_LEAN #include std::wstring s2ws( const std::string &s ) { // get size for buffer and allocate it int len; int slength = (int)s.length( )+1; len = MultiByteToWideChar( CP_ACP, 0, s.c_str( ), slength, 0, 0 ); wchar_t *buf = new wchar_t[len]; // convert MultiByteToWideChar( CP_ACP, 0, s.c_str( ), slength, buf, len ); std::wstring res( buf ); delete[] buf; return res; }