[issue10972] zipfile: add "unicode" option to the force the filename encoding to UTF-8

Antoine Pitrou report at bugs.python.org
Fri Jan 21 16:12:25 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> > The question is, rather, why you need an external flag for that.
> 
> Because I don't want to change the default encoding. I am not sure
> that all applications support UTF-8 encodings.

If this is a ZIP standard flag, why should we care about applications
which don't support it? Should we add other flags to disable other
features out of fear that other applications might not support them
either?

> But if you control your environment, force UTF-8 encoding should
> improve your Unicode support.

How is a random user supposed to know if their tools support UTF-8
encoding? It's not like everyone is an expert in ZIP files. This is the
kind of situation where asking the user to make a choice is more
confusing than helpful. When adding the flag, not only you complicate
the API, but you have to support this flag for the rest of your life
(well, almost :-)).

We could instead use utf-8 by default for all non-ascii filenames (and
*perhaps* have a separate force_cp437 flag, but default it to False).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10972>
_______________________________________


More information about the Python-bugs-list mailing list