From 75a6a1be84604f2642011d17262aef1c83913e54 Mon Sep 17 00:00:00 2001 From: Jeod <47716344+JeodC@users.noreply.github.com> Date: Sat, 30 May 2026 09:44:18 -0400 Subject: [PATCH] Fix special characters in path #126 --- src/port/GameExtractor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/port/GameExtractor.cpp b/src/port/GameExtractor.cpp index a0dbba5c5..2c76fd82f 100644 --- a/src/port/GameExtractor.cpp +++ b/src/port/GameExtractor.cpp @@ -33,6 +33,10 @@ std::unordered_map mGameList = { { "9bef1128717f958171a4afac3ed78ee2bb4e86ce", "Super Mario 64 (US)" }, }; +static std::filesystem::path Utf8ToFsPath(const std::string& utf8) { + return std::filesystem::path(reinterpret_cast(utf8.c_str())); +} + bool GameExtractor::RunStandalone(std::string rom) { // Store both path and already-read data std::string romPath; @@ -117,12 +121,13 @@ bool GameExtractor::SelectGameFromUI() { // Load file if it is not already open if (romData.empty()) { - if (!std::filesystem::exists(romPath)) { + const std::filesystem::path romFsPath = Utf8ToFsPath(romPath); + if (!std::filesystem::exists(romFsPath)) { SPDLOG_ERROR("Failed to find ROM at path: {}", romPath); return false; } - std::ifstream inFile(romPath, std::ios::binary); + std::ifstream inFile(romFsPath, std::ios::binary); if (!inFile.is_open()) { return false; }