diff --git a/ArcFormats/ArcFormats.csproj b/ArcFormats/ArcFormats.csproj index 980a4557..c5f9b2c0 100644 --- a/ArcFormats/ArcFormats.csproj +++ b/ArcFormats/ArcFormats.csproj @@ -135,6 +135,8 @@ + + diff --git a/ArcFormats/Artemis/ArcPFS.cs b/ArcFormats/Artemis/ArcPFS.cs index c8147d4f..b88f7a85 100644 --- a/ArcFormats/Artemis/ArcPFS.cs +++ b/ArcFormats/Artemis/ArcPFS.cs @@ -23,11 +23,11 @@ // IN THE SOFTWARE. // -using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Security.Cryptography; +using System.Text; namespace GameRes.Formats.Artemis { @@ -42,9 +42,12 @@ namespace GameRes.Formats.Artemis public PfsOpener () { - Extensions = new string[] { "pfs", "000", "001", "002", "003" }; + Extensions = new string[] { "pfs", "000", "001", "002", "003", "004", "005" }; + Settings = new[] { PfsEncoding }; } + EncodingSetting PfsEncoding = new EncodingSetting ("PFSEncodingCP"); + public override ArcFile TryOpen (ArcView file) { if (!file.View.AsciiEqual (0, "pf")) @@ -65,7 +68,7 @@ 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 encoding = PfsEncoding.Get(); var index = file.View.ReadBytes (7, index_size); int index_offset = 4; var dir = new List (count); diff --git a/ArcFormats/Properties/Settings.Designer.cs b/ArcFormats/Properties/Settings.Designer.cs index 0610cb60..6f0a1574 100644 --- a/ArcFormats/Properties/Settings.Designer.cs +++ b/ArcFormats/Properties/Settings.Designer.cs @@ -741,5 +741,17 @@ namespace GameRes.Formats.Properties { this["OGGFixCrc"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("65001")] + public int PFSEncodingCP { + get { + return ((int)(this["PFSEncodingCP"])); + } + set { + this["PFSEncodingCP"] = value; + } + } } } diff --git a/ArcFormats/Properties/Settings.settings b/ArcFormats/Properties/Settings.settings index db7c27c8..1027fb43 100644 --- a/ArcFormats/Properties/Settings.settings +++ b/ArcFormats/Properties/Settings.settings @@ -182,5 +182,8 @@ False + + 65001 + \ No newline at end of file diff --git a/ArcFormats/Strings/arcStrings.Designer.cs b/ArcFormats/Strings/arcStrings.Designer.cs index be1dafb9..65f20dd1 100644 --- a/ArcFormats/Strings/arcStrings.Designer.cs +++ b/ArcFormats/Strings/arcStrings.Designer.cs @@ -660,6 +660,15 @@ namespace GameRes.Formats.Strings { } } + /// + /// Looks up a localized string similar to Default file names encoding. + /// + public static string PFSEncodingCP { + get { + return ResourceManager.GetString("PFSEncodingCP", resourceCulture); + } + } + /// /// Looks up a localized string similar to Use default encryption scheme. /// diff --git a/ArcFormats/Strings/arcStrings.ja-JP.resx b/ArcFormats/Strings/arcStrings.ja-JP.resx index fa0ef841..f350c4d7 100644 --- a/ArcFormats/Strings/arcStrings.ja-JP.resx +++ b/ArcFormats/Strings/arcStrings.ja-JP.resx @@ -498,4 +498,7 @@ Choose encryption scheme or enter a passphrase. Default file names encoding + + Default file names encoding + \ No newline at end of file diff --git a/ArcFormats/Strings/arcStrings.ko-KR.resx b/ArcFormats/Strings/arcStrings.ko-KR.resx index 6b079a3c..f2b54c4c 100644 --- a/ArcFormats/Strings/arcStrings.ko-KR.resx +++ b/ArcFormats/Strings/arcStrings.ko-KR.resx @@ -399,4 +399,8 @@ Default file names encoding translation pending + + Default file names encoding + translation pending + \ No newline at end of file diff --git a/ArcFormats/Strings/arcStrings.resx b/ArcFormats/Strings/arcStrings.resx index 022e03d1..3543e6f7 100644 --- a/ArcFormats/Strings/arcStrings.resx +++ b/ArcFormats/Strings/arcStrings.resx @@ -398,4 +398,7 @@ Choose encryption scheme or enter a passphrase. Default file names encoding + + Default file names encoding + \ No newline at end of file diff --git a/ArcFormats/Strings/arcStrings.ru-RU.resx b/ArcFormats/Strings/arcStrings.ru-RU.resx index fe4fde9b..ed00719e 100644 --- a/ArcFormats/Strings/arcStrings.ru-RU.resx +++ b/ArcFormats/Strings/arcStrings.ru-RU.resx @@ -291,6 +291,9 @@ Шифровать содержимое + + Кодировка имён файлов + "Старый" метод шифрования diff --git a/ArcFormats/Strings/arcStrings.zh-Hans.resx b/ArcFormats/Strings/arcStrings.zh-Hans.resx index ba6cd0a2..0d256a66 100644 --- a/ArcFormats/Strings/arcStrings.zh-Hans.resx +++ b/ArcFormats/Strings/arcStrings.zh-Hans.resx @@ -400,4 +400,8 @@ Default file names encoding translation pending + + Default file names encoding + translation pending + \ No newline at end of file diff --git a/ArcFormats/app.config b/ArcFormats/app.config index 4572b883..9904da27 100644 --- a/ArcFormats/app.config +++ b/ArcFormats/app.config @@ -184,6 +184,9 @@ False + + 65001 +