Convert STFS filenames from Win-1252 to UTF-8

This commit is contained in:
NicknineTheEagle
2024-09-22 20:24:37 +03:00
committed by Radosław Gliński
parent 60b31af811
commit 6cba5ba7e6
5 changed files with 89 additions and 4 deletions

View File

@@ -140,7 +140,9 @@ bool DiscImageDevice::ReadEntry(ParseState* state, const uint8_t* buffer,
return false;
}
auto name = std::string(name_buffer, name_length);
// Filename is stored as Windows-1252, convert it to UTF-8.
auto ansi_name = std::string(name_buffer, name_length);
auto name = xe::win1252_to_utf8(ansi_name);
auto entry = DiscImageEntry::Create(this, parent, name, mmap_.get());
entry->attributes_ = attributes | kFileAttributeReadOnly;