fix: Windows system error messages not being encoded correctly

This commit is contained in:
WerWolv
2025-01-28 19:33:31 +01:00
parent 19a9786bbf
commit d45dd45720
4 changed files with 7 additions and 7 deletions

View File

@@ -204,7 +204,7 @@ namespace hex::plugin::builtin {
{
wolv::io::File file(m_path, wolv::io::File::Mode::Read);
if (!file.isValid()) {
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(file.getOpenError().value_or(0))));
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), formatSystemError(file.getOpenError().value_or(0))));
return false;
}
@@ -237,7 +237,7 @@ namespace hex::plugin::builtin {
file = wolv::io::File(m_path, wolv::io::File::Mode::Read);
if (!file.isValid()) {
m_readable = false;
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(file.getOpenError().value_or(0))));
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), formatSystemError(file.getOpenError().value_or(0))));
return false;
}
@@ -311,7 +311,7 @@ namespace hex::plugin::builtin {
fullPath = path;
if (!wolv::io::fs::exists(fullPath)) {
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(ENOENT)));
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), formatSystemError(ENOENT)));
}
path = std::move(fullPath);