0 votes
by (140 points)
edited

When opening ZIP archive containing Extended ASCII Codes the filename result string is wrong.

For example: civiltà.png

For Each item As ZipItem In items
     If item.IsFile Then
          Console.WriteLine(item.Name)
     End If
Next

item.Name is civilt....png

How can I resolve this issue? Thank you advance.

Daniele

Applies to: Rebex ZIP
by (140 points)
edited

In our testing if you create ZIP with REBEX all works fine. If you create a zip file using windows zip utility and after extract with rebex it doesn't work.

1 Answer

0 votes
by (73.5k points)
edited

It is a bug caused by using an invalid Encoding. It will be fixed in next version. In the meantime please use the following method as a workaround for incorrectly encoded names:

public static string FixEncoding(string text)
{
    Encoding cp437 = Encoding.GetEncoding(437);
    return cp437.GetString(Encoding.Default.GetBytes(text));
}

Thank you for pointing to this and we are sorry for any inconveniences.

UPDATE

The fix is part of Release 2012 R1. Default charset changed to IBM437 (used to be Encoding.Default).

...