| 83 | } |
| 84 | |
| 85 | std::wstring ConvertUtf8orAnsiToWide(const std::string_view sv) |
| 86 | { |
| 87 | UINT codePage = CP_UTF8; |
| 88 | int count = MultiByteToWideChar(codePage, MB_ERR_INVALID_CHARS, sv.data(), (int)sv.length(), nullptr, 0); |
| 89 | if (count == 0) { |
| 90 | codePage = CP_ACP; |
| 91 | count = MultiByteToWideChar(codePage, 0, sv.data(), (int)sv.length(), nullptr, 0); |
| 92 | } |
| 93 | std::wstring wstr(count, 0); |
| 94 | MultiByteToWideChar(codePage, 0, sv.data(), (int)sv.length(), &wstr[0], count); |
| 95 | return wstr; |
| 96 | } |
| 97 | |
| 98 | std::string ConvertWideToAnsi(const std::wstring_view wsv) |
| 99 | { |
nothing calls this directly
no outgoing calls
no test coverage detected