| 66 | } |
| 67 | |
| 68 | std::wstring utf8_to_wstring(const char *source) { |
| 69 | auto bytes = convert("UTF-8", "UCS-2LE//IGNORE", source, strlen(source), (utf8_length(source) + 1) * sizeof(wchar_t)); |
| 70 | if (bytes.empty()) |
| 71 | return {}; |
| 72 | return reinterpret_cast<const wchar_t *>(bytes.data()); |
| 73 | } |
| 74 | |
| 75 | std::string utf8_to_string(const char *source) { |
| 76 | auto bytes = convert("UTF-8", "CHAR//IGNORE", source, strlen(source), utf8_length(source) + 1); |
no test coverage detected