| 38 | #include <tlhelp32.h> |
| 39 | |
| 40 | static std::string conv(const std::wstring &str) |
| 41 | { |
| 42 | std::string ret; |
| 43 | // worst case each char takes 4 bytes to encode |
| 44 | ret.resize(str.size() * 4 + 1); |
| 45 | |
| 46 | WideCharToMultiByte(CP_UTF8, 0, str.c_str(), -1, &ret[0], (int)ret.size(), NULL, NULL); |
| 47 | |
| 48 | ret.resize(strlen(ret.c_str())); |
| 49 | |
| 50 | return ret; |
| 51 | } |
| 52 | |
| 53 | static std::wstring conv(const std::string &str) |
| 54 | { |