Hi! On Tue, Oct 15, 2013 at 12:22:29PM +0200, "\"Martin v. L?wis\"" <martin at v.loewis.de> wrote: > Am 15.10.13 10:53, schrieb Daniel Holth: > > FYI zipfile does do UTF-8 > > (http://hg.python.org/cpython/file/d7ebe03fa752/Lib/zipfile.py#l368). > > Only the non-Unicode encodings might need some help. I like that the > > patch is only concerned with decoding. Is it necessary to support > > writing non-UTF8 encodings? > > For purity, no. For practicality, perhaps. It might be that some tools > don't know how to unpack files marked as UTF-8, and always default to > the system code page. > > OTOH, before accepting such a change, I'd like to know what actual > existing tool would require such a hack, and a confirmation that this > very tool indeed does not support UTF-8. Just an example how I create and extract zip files with Russian filenames on Linux: http://phdru.name/Software/Python/misc/zip.py.txt http://phdru.name/Software/Python/misc/unzip.py.txt I hardcoded cp866 encoding to handle zip files the same way other tools (like WinZIP/WinRAR) handle Russian filenames. I hardcoded cp866 encoding into the code because it's the only encoding I've ever saw. cp866 is the OEM encoding in Windows; ANSI encoding is cp1251. Oleg. -- Oleg Broytman http://phdru.name/ phd at phdru.name Programmers don't die, they just GOSUB without RETURN.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4