| 38 | } |
| 39 | |
| 40 | std::wstring to_wstring(std::string_view source) { |
| 41 | auto bytes = convert("CHAR", "UCS-2LE//IGNORE", source.data(), source.length(), sizeof(wchar_t) * (source.length() + 1)); |
| 42 | if (bytes.empty()) |
| 43 | return {}; |
| 44 | return reinterpret_cast<wchar_t *>(bytes.data()); |
| 45 | } |
| 46 | |
| 47 | std::string to_string(std::wstring_view source) { |
| 48 | auto bytes = convert("UCS-2LE", "CHAR//IGNORE", source.data(), (source.length()) * sizeof(wchar_t), sizeof(wchar_t) * (source.length() + 1)); |
no test coverage detected