MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / toUtf16

Function toUtf16

src/Utility/src/String.cpp:116–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 }
115
116 std::wstring toUtf16([[maybe_unused]] const std::string_view& src)
117 {
118#ifdef _WIN32
119 int srcLen = static_cast<int>(src.size());
120 int sizeReq = MultiByteToWideChar(CP_ACP, 0, src.data(), srcLen, nullptr, 0);
121 auto result = std::wstring(sizeReq, 0);
122 MultiByteToWideChar(CP_ACP, 0, src.data(), srcLen, result.data(), sizeReq);
123 return result;
124#else
125 perror("STUB!\n");
126 return std::to_wstring(0);
127#endif
128 }
129}

Callers 3

onCrashFunction · 0.85
initFunction · 0.85
promptDirectoryFunction · 0.85

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected