| 34 | } |
| 35 | |
| 36 | std::wstring sfh::Utf8ToWideString(const std::string& str) |
| 37 | { |
| 38 | std::wstring ret; |
| 39 | const int length = MultiByteToWideChar( |
| 40 | CP_UTF8, |
| 41 | MB_ERR_INVALID_CHARS, |
| 42 | str.c_str(), |
| 43 | static_cast<int>(str.size()), |
| 44 | nullptr, |
| 45 | 0); |
| 46 | assert(length != 0 && "utf8 conversion to wide char mustn't fail!"); |
| 47 | ret.resize(length); |
| 48 | MultiByteToWideChar( |
| 49 | CP_UTF8, |
| 50 | MB_ERR_INVALID_CHARS, |
| 51 | str.c_str(), |
| 52 | static_cast<int>(str.size()), |
| 53 | ret.data(), |
| 54 | length); |
| 55 | return ret; |
| 56 | } |
| 57 | |
| 58 | void sfh::ErrorMessageBox(const std::wstring& text, const std::wstring& caption, long hResult) |
| 59 | { |
nothing calls this directly
no outgoing calls
no test coverage detected