MCPcopy Create free account
hub / github.com/Apache553/SubtitleFontHelper / Utf8ToWideString

Function Utf8ToWideString

FontDatabaseBuilder/Win32Helper.h:20–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20inline std::wstring Utf8ToWideString(const std::string& str)
21{
22 std::wstring ret;
23 const int length = MultiByteToWideChar(
24 CP_UTF8,
25 MB_ERR_INVALID_CHARS,
26 str.c_str(),
27 static_cast<int>(str.size()),
28 nullptr,
29 0);
30 assert(length != 0 && "utf8 conversion to wide char mustn't fail!");
31 ret.resize(length);
32 MultiByteToWideChar(
33 CP_UTF8,
34 MB_ERR_INVALID_CHARS,
35 str.c_str(),
36 static_cast<int>(str.size()),
37 ret.data(),
38 length);
39 return ret;
40}
41
42inline bool IsDirectory(const wchar_t* path)
43{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected