From 0d9ea8a1d15f7e85cffd5fb42bfeffd47c5f1d95 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 12 Feb 2026 22:02:41 +0100 Subject: [PATCH] fix: Project file saving not working corectly when paths contains non-ascii characters Fixes #2654 --- lib/libimhex/source/helpers/tar.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/libimhex/source/helpers/tar.cpp b/lib/libimhex/source/helpers/tar.cpp index 7cbd86130..84f937f77 100644 --- a/lib/libimhex/source/helpers/tar.cpp +++ b/lib/libimhex/source/helpers/tar.cpp @@ -7,6 +7,8 @@ #include +#include "wolv/utils/string.hpp" + namespace hex { using namespace hex::literals; @@ -22,13 +24,13 @@ namespace hex { m_ctx = std::make_unique(); - auto shortPath = wolv::io::fs::toShortPath(path); + auto shortPath = wolv::io::fs::toNormalizedPathString(wolv::io::fs::toShortPath(path)); if (mode == Tar::Mode::Read) - tarError = mtar_open(m_ctx.get(), shortPath.string().c_str(), "r"); + tarError = mtar_open(m_ctx.get(), shortPath.c_str(), "r"); else if (mode == Tar::Mode::Write) - tarError = mtar_open(m_ctx.get(), shortPath.string().c_str(), "a"); + tarError = mtar_open(m_ctx.get(), shortPath.c_str(), "a"); else if (mode == Tar::Mode::Create) - tarError = mtar_open(m_ctx.get(), shortPath.string().c_str(), "w"); + tarError = mtar_open(m_ctx.get(), shortPath.c_str(), "w"); else tarError = MTAR_EFAILURE; @@ -187,4 +189,4 @@ namespace hex { } } -} \ No newline at end of file +}