| 10 | |
| 11 | namespace NFsPrivate { |
| 12 | static LPCWSTR UTF8ToWCHAR(const TStringBuf str, TUtf16String& wstr) { |
| 13 | wstr.resize(str.size()); |
| 14 | size_t written = 0; |
| 15 | if (!UTF8ToWide(str.data(), str.size(), wstr.begin(), written)) { |
| 16 | return nullptr; |
| 17 | } |
| 18 | wstr.erase(written); |
| 19 | static_assert(sizeof(WCHAR) == sizeof(wchar16), "expect sizeof(WCHAR) == sizeof(wchar16)"); |
| 20 | return (const WCHAR*)wstr.data(); |
| 21 | } |
| 22 | |
| 23 | static TString WCHARToUTF8(const LPWSTR wstr, size_t len) { |
| 24 | static_assert(sizeof(WCHAR) == sizeof(wchar16), "expect sizeof(WCHAR) == sizeof(wchar16)"); |
no test coverage detected