MCPcopy Create free account
hub / github.com/Kitware/VTK / UTF8ToWString

Function UTF8ToWString

ThirdParty/libproj/vtklibproj/src/filemanager.cpp:401–412  ·  view source on GitHub ↗

May throw exceptions

Source from the content-addressed store, hash-verified

399
400// May throw exceptions
401static std::wstring UTF8ToWString(const std::string &str) {
402 std::wstring wstr;
403 wstr.resize(str.size());
404 wstr.resize(utf8towc(str.data(), static_cast<unsigned>(str.size()),
405 &wstr[0], static_cast<unsigned>(wstr.size()) + 1));
406 for (const auto ch : wstr) {
407 if (ch == 0xfffd) {
408 throw NonValidUTF8Exception();
409 }
410 }
411 return wstr;
412}
413
414// ---------------------------------------------------------------------------
415

Callers 7

openMethod · 0.85
existsMethod · 0.85
mkdirMethod · 0.85
unlinkMethod · 0.85
renameMethod · 0.85
getProjLibEnvVarMethod · 0.85
pj_open_lib_internalFunction · 0.85

Calls 5

utf8towcFunction · 0.85
resizeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected