#4432 closed defect (worksforme)
Filenames in Zip-Downloads corrupted
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | version control/browser | Version: | 0.10.2 |
Severity: | minor | Keywords: | preferences, zip |
Cc: | Thijs Triemstra | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Filenames in Zip-Downloads of whole directories are corrupted when they contain any special chars (like german umlaute). For example ü is replaced by ++.
Attachments (0)
Change History (13)
comment:1 by , 18 years ago
comment:3 by , 18 years ago
Rather as an user preference then, as this corresponds to the client tool used, not to something that can be known from the server side.
comment:4 by , 18 years ago
Well, I think this could be a server config. Because in your project so sould define your filename conventions. and these conventions than match your server config. Or even as an default for the client-option, beacause many users would not know which filenameencoding to use.
comment:5 by , 18 years ago
Description: | modified (diff) |
---|---|
Keywords: | preferences added |
Milestone: | → 0.11 |
Severity: | normal → minor |
Summary: | Filenames in Zip-Downloads coruppted → Filenames in Zip-Downloads corrupted |
It's not a matter of conventions, it's a matter of what filesystem you're using on your computer, and what Zip tools you're using. See r3096.
E.g. I think that on Macintosh, a popular Zip tool expects UTF-8 encoded filenames.
But yes, we could try to pick up some "sane" default if the user preference is not set, e.g. the same as the configured default charset for the repository.
comment:7 by , 14 years ago
Cc: | added |
---|
comment:8 by , 14 years ago
Keywords: | zip added |
---|
comment:9 by , 14 years ago
trunk/trac/versioncontrol/web_ui/changeset.py has:
zipinfo.filename = new_node.path.strip('/').encode('utf-8') # Note: unicode filenames are not supported by zipfile. # UTF-8 is not supported by all Zip tools either, # but as some do, I think UTF-8 is the best option here.
comment:10 by , 10 years ago
Keywords: | preferences zip → preferences, zip |
---|
comment:11 by , 9 years ago
Owner: | removed |
---|
follow-up: 13 comment:12 by , 6 years ago
The comment:9 refers to this code, but it was later moved to trac.versioncontrol.web_ui.util.render_zip, and from there moved again to trac.util.create_zipinfo.
Also the "Language Encoding flag" is now set there (since #10679) to indicate filenames are UTF-8 encoded, but comment:2:ticket:10679:
So I suppose this would fix #4432?
I think that it should keep open, because Zip folder in Windows cannot handle the bit.
I think that Windows users need "encoding for zip archive" option in trac.ini and user preference.
zip folder in Windows XP and 7 extracts broken filename
Testing with a ZIP (created with 7-Zip) containing filename €.ü
, Windows 10 Zip folder seems to work now, but I have not tested ZIP files created by Trac.
comment:13 by , 6 years ago
Milestone: | next-major-releases |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Replying to anonymous:
Testing with a ZIP (created with 7-Zip) containing filename
€.ü
, Windows 10 Zip folder seems to work now, but I have not tested ZIP files created by Trac.
Thanks for the information. I just tested zip file generated by Trac 1.0.15 on Windows 10. The zip folder works fine and unicode file name extracted from the zip file are correct.
Closing by #10679.
Well, the filename is currently saved as an UTF-8 string, which is not supported by all Zip tools. Last time I've checked, other choices were even worse/less portable.
What would you suggest?