MCPcopy Create free account
hub / github.com/assimp/assimp / WideToUtf8

Function WideToUtf8

code/Common/DefaultIOSystem.cpp:80–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78const std::string dummy;
79
80static std::string WideToUtf8(const wchar_t *in) {
81 if (nullptr == in) {
82 return dummy;
83 }
84 int size = WideCharToMultiByte(CP_UTF8, 0, in, -1, nullptr, 0, nullptr, nullptr);
85 // size includes terminating null; std::string adds null automatically
86 std::string out(static_cast<size_t>(size) - 1, '\0');
87 WideCharToMultiByte(CP_UTF8, 0, in, -1, &out[0], size, nullptr, nullptr);
88
89 return out;
90}
91#endif
92
93// ------------------------------------------------------------------------------------------------

Callers 1

MakeAbsolutePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected