Fix #12648: Ensure all uses of std::filesystem::path use native encoding. (#12650)

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:
Peter Nelson
2024-06-09 10:23:47 +01:00
committed by GitHub
parent fce9361bf2
commit b4b2fad8e0
6 changed files with 14 additions and 14 deletions

View File

@@ -245,7 +245,7 @@ static bool _ValidateSignatureFile(const std::string &filename)
return false;
}
std::string dirname = std::filesystem::path(filename).parent_path().string();
std::string dirname = FS2OTTD(std::filesystem::path(OTTD2FS(filename)).parent_path());
for (auto &signature : signatures["files"]) {
const std::string sig_filename = dirname + PATHSEPCHAR + signature["filename"].get<std::string>();