Skip to content

Commit

Permalink
attempt at correct utf8 decoding for toml config file path
Browse files Browse the repository at this point in the history
  • Loading branch information
RSDuck committed Jul 30, 2024
1 parent 01c2d65 commit b778fba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/frontend/qt_sdl/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <inttypes.h>
#include <iostream>
#include <fstream>
#include <filesystem>
#include <regex>
#include "toml/toml.hpp"

Expand Down Expand Up @@ -741,7 +742,7 @@ bool Load()

try
{
RootTable = toml::parse(cfgpath);
RootTable = toml::parse(std::filesystem::u8path(cfgpath));
}
catch (toml::syntax_error& err)
{
Expand All @@ -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();
}
Expand Down

0 comments on commit b778fba

Please sign in to comment.