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

Function Utf8ToWideChar

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

Source from the content-addressed store, hash-verified

26namespace tensorflow {
27
28inline std::wstring Utf8ToWideChar(const string& utf8str) {
29 int size_required = MultiByteToWideChar(CP_UTF8, 0, utf8str.c_str(),
30 (int)utf8str.size(), NULL, 0);
31 std::wstring ws_translated_str(size_required, 0);
32 MultiByteToWideChar(CP_UTF8, 0, utf8str.c_str(), (int)utf8str.size(),
33 &ws_translated_str[0], size_required);
34 return ws_translated_str;
35}
36
37inline string WideCharToUtf8(const std::wstring& wstr) {
38 if (wstr.empty()) return std::string();

Callers 14

MatchPathMethod · 0.85
LoadLibraryMethod · 0.85
NewRandomAccessFileMethod · 0.85
NewWritableFileMethod · 0.85
NewAppendableFileMethod · 0.85
FileExistsMethod · 0.85
GetChildrenMethod · 0.85
DeleteFileMethod · 0.85
CreateDirMethod · 0.85
DeleteDirMethod · 0.85
GetFileSizeMethod · 0.85

Calls 2

c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected