[issue11574] Unicode Fallback Encoding on Python 3.3

STINNER Victor report at bugs.python.org
Fri Mar 18 14:04:56 CET 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

TextIOWrapper is mostly based on locale.getpreferredencoding(), so msg131290 is still valid: if no env var is set, nl_langinfo() gives 'ASCII' (or something like that). But it is not easy to detect that env vars are not set.

I would prefer a completly different approach: always use UTF-8 by default if the encoding is not set.

Something like:
def open(filename, ..., encoding='UTF-8', ...)
TextIOWrapper.__init__(..., encoding='UTF-8', ...)

So not rely on locales anymore.

----------

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


More information about the Python-bugs-list mailing list