| 37 | } |
| 38 | |
| 39 | std::wstring utf8_to_utf16(const std::string& _source) |
| 40 | { |
| 41 | const char* srcPtr = _source.c_str(); |
| 42 | int tmpSize = MultiByteToWideChar( CP_UTF8, 0, srcPtr, -1, 0, 0 ); |
| 43 | WCHAR* tmpBuff = new WCHAR [ tmpSize + 1 ]; |
| 44 | MultiByteToWideChar( CP_UTF8, 0, srcPtr, -1, tmpBuff, tmpSize ); |
| 45 | std::wstring ret = tmpBuff; |
| 46 | delete[] tmpBuff; |
| 47 | return ret; |
| 48 | } |
| 49 | |
| 50 | std::wstring ansi_to_utf16(const std::string& _source) |
| 51 | { |