MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / WideCharToUtf8

Function WideCharToUtf8

tensorflow/core/platform/windows/wide_char.h:37–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37inline string WideCharToUtf8(const std::wstring& wstr) {
38 if (wstr.empty()) return std::string();
39 int size_required = WideCharToMultiByte(
40 CP_UTF8, 0, wstr.c_str(), (int)wstr.size(), NULL, 0, NULL, NULL);
41 string utf8_translated_str(size_required, 0);
42 WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), (int)wstr.size(),
43 &utf8_translated_str[0], size_required, NULL, NULL);
44 return utf8_translated_str;
45}
46
47} // namespace tensorflow
48

Callers 2

GetExecutablePathMethod · 0.85
GetChildrenMethod · 0.85

Calls 3

c_strMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected