| 64 | |
| 65 | #if defined(_WIN32) || defined(_WIN64) |
| 66 | std::wstring LocalWideFromUtf8(const std::string& text) { |
| 67 | if (text.empty()) { |
| 68 | return L""; |
| 69 | } |
| 70 | const int size = MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, nullptr, |
| 71 | 0); |
| 72 | if (size <= 1) { |
| 73 | return L""; |
| 74 | } |
| 75 | std::wstring wide(static_cast<size_t>(size), L'\0'); |
| 76 | MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, &wide[0], size); |
| 77 | wide.resize(static_cast<size_t>(size - 1)); |
| 78 | return wide; |
| 79 | } |
| 80 | #endif |
| 81 | |
| 82 | std::string ParentDir(const std::string& path) { |
no test coverage detected