Skip to content
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

Issue when creating zip file with Unicode filenames inside #84

Open
cerisola opened this issue Nov 2, 2021 · 0 comments · May be fixed by #85 or #103
Open

Issue when creating zip file with Unicode filenames inside #84

cerisola opened this issue Nov 2, 2021 · 0 comments · May be fixed by #85 or #103

Comments

@cerisola
Copy link

cerisola commented Nov 2, 2021

Hi, I am running into issues when using ZipFile.jl to create a zip archive that contains files with unicode names. Consider this minimal example:

using ZipFile

dir = ZipFile.Writer("unicode_test.zip")
f = ZipFile.addfile(dir, "α.txt"; method=ZipFile.Store)
write(f, "hi")
close(dir)

If I open the file with ZipFile.jl I can read the contents fine. However, when using other zip tools they fail to properly get the filename. For example, using the standard "unzip" command found on most linux distros (made by Info-ZIP) I get the following

> unzip unicode_test.zip
Archive:  unicode_test.zip
 extracting: +?.txt
> ls
'+'$'\246''.txt' unicode_test.zip

Of course, this is not an issue with the locale setting of the terminal, I can properly see unicode characters and zip files containing unicode filenames created with other tools work fine.

Another example where the ZipFile.jl-generated file fails is if one tries to open it with Python's official "zipfile" library:

>>> import zipfile
>>> z = zipfile.ZipFile("unicode_test.zip", 'r')
>>> print(z.namelist())
['╬▒.txt']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant