fix: Project file saving not working corectly when paths contains non-ascii characters

Fixes #2654
This commit is contained in:
WerWolv
2026-02-12 22:02:41 +01:00
parent b6a90aa89d
commit 0d9ea8a1d1

View File

@@ -7,6 +7,8 @@
#include <microtar.h>
#include "wolv/utils/string.hpp"
namespace hex {
using namespace hex::literals;
@@ -22,13 +24,13 @@ namespace hex {
m_ctx = std::make_unique<mtar_t>();
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;