mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Apply Zip encoding patch from GordonJ
This commit is contained in:
@@ -33,6 +33,11 @@ namespace Compress.ZipFile
|
||||
|
||||
public ZipStatus ZipStatus { get; set; }
|
||||
|
||||
public Zip()
|
||||
{
|
||||
ZipUtils.EncodeSetup();
|
||||
}
|
||||
|
||||
public int LocalFilesCount()
|
||||
{
|
||||
return _localFiles.Count;
|
||||
|
||||
@@ -7,7 +7,15 @@ namespace Compress.ZipFile
|
||||
{
|
||||
// according to the zip documents, zip filesname are stored as MS-DOS Code Page 437.
|
||||
// (Unless the uncode flag is set, in which case they are stored as UTF-8.
|
||||
private static Encoding enc = Encoding.GetEncoding(437);
|
||||
private static Encoding enc = null;
|
||||
|
||||
public static void EncodeSetup()
|
||||
{
|
||||
if (enc != null)
|
||||
return;
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
enc = Encoding.GetEncoding(437);
|
||||
}
|
||||
|
||||
public static string GetString(byte[] byteArr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user