mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
attempt at correct utf8 decoding for toml config file path
This commit is contained in:
parent
01c2d65f07
commit
b778fbaad1
@ -22,6 +22,7 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <filesystem>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include "toml/toml.hpp"
|
#include "toml/toml.hpp"
|
||||||
|
|
||||||
@ -741,7 +742,7 @@ bool Load()
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
RootTable = toml::parse(cfgpath);
|
RootTable = toml::parse(std::filesystem::u8path(cfgpath));
|
||||||
}
|
}
|
||||||
catch (toml::syntax_error& err)
|
catch (toml::syntax_error& err)
|
||||||
{
|
{
|
||||||
@ -758,7 +759,7 @@ void Save()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
std::ofstream file;
|
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 << RootTable;
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user