Incorrect decoding of the comment in ZipFile.Read() method.


Cyrillic characters in the comment of zip file that encoded in UTF-8 is not decoded properly when ZipFile.Read (string, Encoding) is called. I found a simple solution that solves this problem, but I think it's ugly. Eliminates this way. Some more code in my attach file:
        ZipFile zipfile = ZipFile.Read("zip.zip", Encoding.UTF8); // zip file saved with utf-8 encoding and cyrilic characters in the comment
        byte[] bytes = Encoding.GetEncoding(437).GetBytes(zipfile.Comment);
        textBox2.Text = Encoding.UTF8.GetString(bytes);
P.S. My OS is Windows 7 Ultimate 32bit.
P.P.S. Sorry for my English. I am from Russia and I use Google translator :)

file attachments

Closed Jun 14, 2011 at 2:49 PM by Cheeso
fixed in changeset 79101. First binary that will contain this change: v1.9.1.6


Cheeso wrote Jun 14, 2011 at 2:45 PM

Thank you NikLeo, good report, and good simple test case illustrating the problem.

wrote Jun 14, 2011 at 2:49 PM

wrote Feb 22, 2013 at 2:43 AM

wrote May 16, 2013 at 1:31 PM