| 26 | namespace tensorflow { |
| 27 | |
| 28 | inline 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 | |
| 37 | inline string WideCharToUtf8(const std::wstring& wstr) { |
| 38 | if (wstr.empty()) return std::string(); |
no test coverage detected