mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
(ZIP): added filename encoding setting.
This commit is contained in:
parent
118504e620
commit
816e392d03
@ -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))
|
||||
|
@ -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<Encoding>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
9
ArcFormats/Strings/arcStrings.Designer.cs
generated
9
ArcFormats/Strings/arcStrings.Designer.cs
generated
@ -863,6 +863,15 @@ namespace GameRes.Formats.Strings {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Default file names encoding.
|
||||
/// </summary>
|
||||
public static string ZIPEncodingCP {
|
||||
get {
|
||||
return ResourceManager.GetString("ZIPEncodingCP", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Archive content is encrypted..
|
||||
/// </summary>
|
||||
|
@ -495,4 +495,7 @@ Choose encryption scheme or enter a passphrase.</comment>
|
||||
<value>Fix Ogg files checksums</value>
|
||||
<comment>Translation pending</comment>
|
||||
</data>
|
||||
<data name="ZIPEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
</data>
|
||||
</root>
|
@ -395,4 +395,8 @@
|
||||
<value>Fix Ogg files checksums</value>
|
||||
<comment>Translation pending</comment>
|
||||
</data>
|
||||
<data name="ZIPEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
<comment>translation pending</comment>
|
||||
</data>
|
||||
</root>
|
@ -395,4 +395,7 @@ Choose encryption scheme or enter a passphrase.</value>
|
||||
<data name="OGGFixCrc" xml:space="preserve">
|
||||
<value>Fix Ogg files checksums</value>
|
||||
</data>
|
||||
<data name="ZIPEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
</data>
|
||||
</root>
|
@ -347,6 +347,9 @@
|
||||
<data name="YPFTryGuess" xml:space="preserve">
|
||||
<value>Попытаться подобрать</value>
|
||||
</data>
|
||||
<data name="ZIPEncodingCP" xml:space="preserve">
|
||||
<value>Кодировка имён файлов</value>
|
||||
</data>
|
||||
<data name="ZIPEncryptedNotice" xml:space="preserve">
|
||||
<value>Содержимое архива зашифровано.</value>
|
||||
</data>
|
||||
|
@ -396,4 +396,8 @@
|
||||
<value>Fix Ogg files checksums</value>
|
||||
<comment>Translation pending</comment>
|
||||
</data>
|
||||
<data name="ZIPEncodingCP" xml:space="preserve">
|
||||
<value>Default file names encoding</value>
|
||||
<comment>translation pending</comment>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user