1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-21 19:32:54 +01:00

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

@@ -489,7 +489,7 @@ bool TarScanner::AddFile(const std::string &filename, size_t, [[maybe_unused]] c
_tar_list[this->subdir][filename] = std::string{};
std::string filename_base = std::filesystem::path(filename).filename().string();
std::string filename_base = FS2OTTD(std::filesystem::path(OTTD2FS(filename)).filename());
SimplifyFileName(filename_base);
TarHeader th;