Hi! On Tue, Oct 15, 2013 at 12:22:29PM +0200, "\"Martin v. L?wis\"" <[email protected]> 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/ [email protected] Programmers don't die, they just GOSUB without RETURN. _______________________________________________ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
