Convert an UTF8 string to a wide Unicode String
| 19 | |
| 20 | // Convert an UTF8 string to a wide Unicode String |
| 21 | std::wstring utf8_decode(const std::string& str) |
| 22 | { |
| 23 | if (str.empty()) |
| 24 | { |
| 25 | return std::wstring(); |
| 26 | } |
| 27 | |
| 28 | int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int) str.size(), nullptr, 0); |
| 29 | std::wstring wstrTo(size_needed, 0); |
| 30 | MultiByteToWideChar(CP_UTF8, 0, &str[0], (int) str.size(), &wstrTo[0], size_needed); |
| 31 | return wstrTo; |
| 32 | } |
| 33 | |
| 34 | bool isMatch(const std::string& value, const std::regex& re) |
| 35 | { |
no test coverage detected