std::filesystem::path does not expect UTF-8 strings, so they must be converted to native format first (and back to utf-8 after.)
This commit is contained in:
@@ -578,7 +578,7 @@ int openttd_main(std::span<char * const> arguments)
|
||||
if (mgo.opt != nullptr) {
|
||||
_file_to_saveload.name = mgo.opt;
|
||||
|
||||
std::string extension = std::filesystem::path(_file_to_saveload.name).extension().string();
|
||||
std::string extension = FS2OTTD(std::filesystem::path(OTTD2FS(_file_to_saveload.name)).extension());
|
||||
auto [ft, _] = FiosGetSavegameListCallback(SLO_LOAD, _file_to_saveload.name, extension);
|
||||
if (ft == FIOS_TYPE_INVALID) {
|
||||
std::tie(ft, _) = FiosGetScenarioListCallback(SLO_LOAD, _file_to_saveload.name, extension);
|
||||
@@ -612,7 +612,7 @@ int openttd_main(std::span<char * const> arguments)
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string extension = std::filesystem::path(mgo.opt).extension().string();
|
||||
std::string extension = FS2OTTD(std::filesystem::path(OTTD2FS(mgo.opt)).extension());
|
||||
auto [_, title] = FiosGetSavegameListCallback(SLO_LOAD, mgo.opt, extension);
|
||||
|
||||
_load_check_data.Clear();
|
||||
|
||||
Reference in New Issue
Block a user