diff --git a/ArcFormats/PalmTree/ArcAR.cs b/ArcFormats/PalmTree/ArcAR.cs index 27e8b412..1182bc0c 100644 --- a/ArcFormats/PalmTree/ArcAR.cs +++ b/ArcFormats/PalmTree/ArcAR.cs @@ -44,6 +44,11 @@ namespace GameRes.Formats.PalmTree static readonly byte[] ArDirSignature = { (byte)'A', (byte)'R', 5, 6 }; + public ArcOpener () + { + Settings = null; + } + public override ArcFile TryOpen (ArcView file) { if (-1 == SearchForSignature (file, ArDirSignature)) diff --git a/ArcFormats/PkWare/ArcZIP.cs b/ArcFormats/PkWare/ArcZIP.cs index 18ab2568..52e5d359 100644 --- a/ArcFormats/PkWare/ArcZIP.cs +++ b/ArcFormats/PkWare/ArcZIP.cs @@ -100,6 +100,13 @@ namespace GameRes.Formats.PkWare static readonly byte[] PkDirSignature = { (byte)'P', (byte)'K', 5, 6 }; + public ZipOpener () + { + Settings = new[] { ZipEncoding }; + } + + EncodingSetting ZipEncoding = new EncodingSetting ("ZIPEncodingCP"); + public override ArcFile TryOpen (ArcView file) { if (-1 == SearchForSignature (file, PkDirSignature)) @@ -182,7 +189,7 @@ namespace GameRes.Formats.PkWare Encoding enc; try { - enc = Encoding.GetEncoding (Properties.Settings.Default.ZIPEncodingCP); + enc = ZipEncoding.Get(); } catch { diff --git a/ArcFormats/ResourceSettings.cs b/ArcFormats/ResourceSettings.cs index af1f9e56..0a53132f 100644 --- a/ArcFormats/ResourceSettings.cs +++ b/ArcFormats/ResourceSettings.cs @@ -4,6 +4,7 @@ // using System.ComponentModel.Composition; +using System.Text; using GameRes.Formats.Strings; namespace GameRes.Formats @@ -24,6 +25,18 @@ namespace GameRes.Formats } } + internal class EncodingSetting : LocalResourceSetting + { + public override object Value { + get { return Encoding.GetEncoding ((int)base.Value); } + set { base.Value = ((Encoding)value).CodePage; } + } + + public EncodingSetting () { } + + public EncodingSetting (string name) : base (name) { } + } + [Export(typeof(ISettingsManager))] internal class SettingsManager : ISettingsManager { diff --git a/ArcFormats/Strings/arcStrings.Designer.cs b/ArcFormats/Strings/arcStrings.Designer.cs index c8be97dc..be1dafb9 100644 --- a/ArcFormats/Strings/arcStrings.Designer.cs +++ b/ArcFormats/Strings/arcStrings.Designer.cs @@ -863,6 +863,15 @@ namespace GameRes.Formats.Strings { } } + /// + /// Looks up a localized string similar to Default file names encoding. + /// + public static string ZIPEncodingCP { + get { + return ResourceManager.GetString("ZIPEncodingCP", resourceCulture); + } + } + /// /// Looks up a localized string similar to Archive content is encrypted.. /// diff --git a/ArcFormats/Strings/arcStrings.ja-JP.resx b/ArcFormats/Strings/arcStrings.ja-JP.resx index e804ada7..fa0ef841 100644 --- a/ArcFormats/Strings/arcStrings.ja-JP.resx +++ b/ArcFormats/Strings/arcStrings.ja-JP.resx @@ -495,4 +495,7 @@ Choose encryption scheme or enter a passphrase. Fix Ogg files checksums Translation pending + + 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 3f1598e9..6b079a3c 100644 --- a/ArcFormats/Strings/arcStrings.ko-KR.resx +++ b/ArcFormats/Strings/arcStrings.ko-KR.resx @@ -395,4 +395,8 @@ Fix Ogg files checksums 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 c1fb8ddf..022e03d1 100644 --- a/ArcFormats/Strings/arcStrings.resx +++ b/ArcFormats/Strings/arcStrings.resx @@ -395,4 +395,7 @@ Choose encryption scheme or enter a passphrase. Fix Ogg files checksums + + 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 227e2966..fe4fde9b 100644 --- a/ArcFormats/Strings/arcStrings.ru-RU.resx +++ b/ArcFormats/Strings/arcStrings.ru-RU.resx @@ -347,6 +347,9 @@ Попытаться подобрать + + Кодировка имён файлов + Содержимое архива зашифровано. diff --git a/ArcFormats/Strings/arcStrings.zh-Hans.resx b/ArcFormats/Strings/arcStrings.zh-Hans.resx index 1116c9fd..ba6cd0a2 100644 --- a/ArcFormats/Strings/arcStrings.zh-Hans.resx +++ b/ArcFormats/Strings/arcStrings.zh-Hans.resx @@ -396,4 +396,8 @@ Fix Ogg files checksums Translation pending + + Default file names encoding + translation pending + \ No newline at end of file