git repos / PlatformFolders

commit 7c06d04d

Firas Assaad · 2020-09-29 21:59
7c06d04d843ac053710e34600ae7f75a15d86572 patch · browse files
parent 54abe09d346a196337abcb1c6a4ec3b532037cc3

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;
}