MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / from_utf8

Function from_utf8

src/base/string.cpp:82–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82std::wstring from_utf8(const std::string& src)
83{
84 int required_size =
85 MultiByteToWideChar(CP_UTF8, 0,
86 src.c_str(), (int)src.size(),
87 NULL, 0);
88
89 if (required_size == 0)
90 return std::wstring();
91
92 std::vector<wchar_t> buf(++required_size);
93
94 ::MultiByteToWideChar(CP_UTF8, 0,
95 src.c_str(), (int)src.size(),
96 &buf[0], required_size);
97
98 return std::wstring(&buf[0]);
99}
100
101#else
102

Callers 15

setTitleMethod · 0.85
handle_dde_messagesFunction · 0.85
setTitleMethod · 0.85
setDefaultExtensionMethod · 0.85
addFilterMethod · 0.85
setFileNameMethod · 0.85
is_fileFunction · 0.85
is_directoryFunction · 0.85
file_sizeFunction · 0.85
move_fileFunction · 0.85
delete_fileFunction · 0.85

Calls 4

utf8_lengthFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

TESTFunction · 0.68