| 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)); |
| 49 | if (bytes.empty()) |
| 50 | return {}; |
| 51 | return bytes.data(); |
| 52 | } |
| 53 | |
| 54 | std::string to_utf8_string(std::string_view source) { |
| 55 | auto bytes = convert("CHAR", "UTF-8//IGNORE", source.data(), source.length(), max_utf8_char_length * (source.length() + 1)); |
no test coverage detected