[issue21331] Reversing an encoding with unicode-escape returns a different result

Martin v. Löwis report at bugs.python.org
Sun Jun 22 22:35:08 CEST 2014


Martin v. Löwis added the comment:

As you say, the unicode-escape codec is tied to the Python language definition. So if the language changes, the codec needs to change as well. 

A Unicode literal in source code might be using any encoding, so to be on the safe side, restricting it to ASCII is meaningful. Or else, if we want to use the default source encoding (as it did in 2.x), we should assume UTF-8 (per PEP 3120). Using ISO-8859-1 is clearly wrong for 3.x.

----------

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


More information about the Python-bugs-list mailing list