From 9ff0da050f9a855b43a11cd9a62a107b7d98943b Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 24 Feb 2018 20:47:46 +0400 Subject: [PATCH] (PFS): use UTF8 encoding for versions 8+. --- ArcFormats/Artemis/ArcPFS.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArcFormats/Artemis/ArcPFS.cs b/ArcFormats/Artemis/ArcPFS.cs index 9f18db9e..c8147d4f 100644 --- a/ArcFormats/Artemis/ArcPFS.cs +++ b/ArcFormats/Artemis/ArcPFS.cs @@ -65,14 +65,14 @@ namespace GameRes.Formats.Artemis int count = file.View.ReadInt32 (7); if (!IsSaneCount (count) || 7L + index_size > file.MaxOffset) return null; - + var encoding = version >= 8 ? System.Text.Encoding.UTF8 : Encodings.cp932; var index = file.View.ReadBytes (7, index_size); int index_offset = 4; var dir = new List (count); for (int i = 0; i < count; ++i) { int name_length = index.ToInt32 (index_offset); - var name = Encodings.cp932.GetString (index, index_offset+4, name_length); + var name = encoding.GetString (index, index_offset+4, name_length); index_offset += name_length + 8; var entry = FormatCatalog.Instance.Create (name); entry.Offset = index.ToUInt32 (index_offset);