MCPcopy Create free account
hub / github.com/MyGUI/mygui / utf8_to_utf16

Function utf8_to_utf16

Wrappers/MyGUI_Managed/Utility.cpp:39–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected