attempt at correct utf8 decoding for toml config file path

This commit is contained in:
RSDuck 2024-07-30 17:48:41 +02:00
parent 01c2d65f07
commit b778fbaad1
1 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@
#include <inttypes.h>
#include <iostream>
#include <fstream>
#include <filesystem>
#include <regex>
#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();
}