c# - Wrong encoding in ZipFile comment -
I am reading a zip file comment using the Ionic.Zip.ZipFile class and there is a problem in the pronunciation letter ( Instead of getting "a" "rich" like "I", I get "a" "reserved."
My code is:
Using the (zip file zipfile) = new zip file (path)) {comment = zip file. comment;} The path is the path of the zip file. I also need to put the encoding directly Using the same result (in this way):
(zip file zip file = new zip file (path, encoding. UTF8)) {comment = zipFile.Comment;} Is there a specific encoding for the comment?
Thanks to, I got the solution
The code is as follows:
The person who uses you needs to get the right encoding of the comment before encoding. (Z Pfail zipfile = Using new zipfile (path)) {byte [] bytes = encoding. Gate Encoding (437) .GetBytes (zipFile.Comment); Comment = encoding. Default.getstrings (bytes); }
Comments
Post a Comment