fix: Native error message formatting on Windows

This commit is contained in:
WerWolv
2024-02-04 20:21:16 +01:00
parent f583df6c7d
commit 77baf6f522
4 changed files with 95 additions and 83 deletions

View File

@@ -750,4 +750,14 @@ namespace hex {
return generateHexViewImpl(offset, data.begin(), data.end());
}
std::string formatSystemError(i32 error) {
auto message = std::system_category().message(error);
#if defined(OS_WINDOWS)
return hex::utf16ToUtf8(hex::utf8ToUtf16(message));
#else
return message;
#endif
}
}