| 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)); |
| 56 | if (bytes.empty()) |
| 57 | return {}; |
| 58 | return bytes.data(); |
| 59 | } |
| 60 | |
| 61 | std::string to_utf8_string(std::wstring_view source) { |
| 62 | auto bytes = convert("UCS-2LE", "UTF-8//IGNORE", source.data(), source.length() * sizeof(wchar_t), max_utf8_char_length * (source.length() + 1)); |
no test coverage detected