commit d318731b
Merge pull request #23 from firas-assaad/fix-utf-exception-message
Fix Windows UTF conversion exception message
Changed files
| M | sago/platform_folders.cpp before |
diff --git a/sago/platform_folders.cpp b/sago/platform_folders.cpp
index 1531e91..f4a1cd1 100644
--- a/sago/platform_folders.cpp
+++ b/sago/platform_folders.cpp
@@ -103,8 +103,7 @@ std::string win32_utf16_to_utf8(const wchar_t* wstr) {
}
if (actualSize == 0) {
// WideCharToMultiByte return 0 for errors.
- const std::string errorMsg = "UTF16 to UTF8 failed with error code: " + GetLastError();
- throw std::runtime_error(errorMsg.c_str());
+ throw std::runtime_error("UTF16 to UTF8 failed with error code: " + std::to_string(GetLastError()));
}
return res;
}