From b778fbaad1ef05f4c1f607f74dc736c1a6967719 Mon Sep 17 00:00:00 2001 From: RSDuck Date: Tue, 30 Jul 2024 17:48:41 +0200 Subject: [PATCH] attempt at correct utf8 decoding for toml config file path --- src/frontend/qt_sdl/Config.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/qt_sdl/Config.cpp b/src/frontend/qt_sdl/Config.cpp index 98749175..998a03ec 100644 --- a/src/frontend/qt_sdl/Config.cpp +++ b/src/frontend/qt_sdl/Config.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "toml/toml.hpp" @@ -741,7 +742,7 @@ bool Load() try { - RootTable = toml::parse(cfgpath); + RootTable = toml::parse(std::filesystem::u8path(cfgpath)); } catch (toml::syntax_error& err) { @@ -758,7 +759,7 @@ void Save() return; std::ofstream file; - file.open(cfgpath, std::ofstream::out | std::ofstream::trunc); + file.open(std::filesystem::u8path(cfgpath), std::ofstream::out | std::ofstream::trunc); file << RootTable; file.close(); }