-
Notifications
You must be signed in to change notification settings - Fork 995
ZipConstants.DefaultCodePage is set as UTF-8, but the default for FileEntry.IsUnicodeText is still false #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you provide a sample file that does not work? You can upload it here by dragging it into the textbox. |
I got the same problem, my file directory contains chinese like '/mnt/img/汉字/1.png', the file in the zip file turned to '/mnt/img/xxx(messy code)/1.png'. |
Hm, I made a simple program to test this (https://gist.github.com/piksel/e4132290380d1744165e878a40d9c44f) And it seems fine on .NET Core 2.1 on linux:
The file name is correct when opened in 7zip and windows explorer: Extracting it with unzip v6.0 on linux does not give the correct file name though:
Generated file: test.zip |
Update to @cerasumat:
|
How to fix it? |
It's work for me. Step1. Step2. |
@tabhuang Yes, you can just use ZipConstants.DefaultCodePage = Encoding.GetEncoding("Big5").CodePage; To use a custom code page for the file names. To use Unicode you have to set the fastZip.EntryFactory = new ZipEntryFactory
{
IsUnicodeText = true
}; |
Turns out, this is a bug after all. The default settings for file name encoding yields the wrong output. |
Uh oh!
There was an error while loading. Please reload this page.
Zip chinese filename, but I get filename with garbled text.
#NET45
#C Sharp
#v1.0.0 RC1
#ZipEntry
https://github.com/icsharpcode/SharpZipLib/releases
Test Chinese Filename
測試.txt
Zip Filename like "測試.txt", but I get filename "皜祈岫.txt".

Version 0.86.0.518 is OK, but 1.0.0 is wrong.
The text was updated successfully, but these errors were encountered: