(NOA): force cp932 encoding for older archives.

This commit is contained in:
morkt 2018-09-16 20:06:23 +04:00
parent 956a2c3839
commit e0c6bff0b9

View File

@ -93,7 +93,9 @@ namespace GameRes.Formats.Entis
uint id = file.View.ReadUInt32 (8); uint id = file.View.ReadUInt32 (8);
if (0x02000400 != id) if (0x02000400 != id)
return null; return null;
var reader = new IndexReader (file, NoaEncoding.Get<Encoding>()); bool old_format = file.View.AsciiEqual (0x10, "EMSAC-Binary Archive");
Encoding enc = old_format ? Encodings.cp932 : NoaEncoding.Get<Encoding>();
var reader = new IndexReader (file, enc);
if (!reader.ParseRoot() || 0 == reader.Dir.Count) if (!reader.ParseRoot() || 0 == reader.Dir.Count)
return null; return null;
if (reader.HasEncrypted) if (reader.HasEncrypted)