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

Function Utf8ToWideString

FontLoadInterceptor/RpcClient.cpp:196–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194 }
195
196 std::wstring Utf8ToWideString(const std::string& str)
197 {
198 std::wstring ret;
199 const int length = MultiByteToWideChar(
200 CP_UTF8,
201 MB_ERR_INVALID_CHARS,
202 str.c_str(),
203 static_cast<int>(str.size()),
204 nullptr,
205 0);
206 if (length <= 0)
207 throw std::runtime_error("MultiByteToWideChar failed");
208 ret.resize(length);
209 MultiByteToWideChar(
210 CP_UTF8,
211 MB_ERR_INVALID_CHARS,
212 str.c_str(),
213 static_cast<int>(str.size()),
214 ret.data(),
215 length);
216 return ret;
217 }
218
219 wil::unique_hfile OpenPipe()
220 {

Callers 5

TryLoadFunction · 0.70
QueryAndLoadFunction · 0.70
HandleRequestMethod · 0.50
LoadLruCacheMethod · 0.50
HandleFeedbackMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected