[issue18713] Enable surrogateescape on stdin and stdout when appropriate

STINNER Victor report at bugs.python.org
Fri Aug 23 00:11:49 CEST 2013


STINNER Victor added the comment:

>>> ('\udcff' + 'qwerty').encode('utf-16le', 'surrogateescape')
b'\xff\xdcq\x00w\x00e\x00r\x00t\x00y\x00'

Oh, this is a bug in the UTF-16 encoder: it should not encode surrogate characters => see issue #12892

I read that it's possible to set a standard stream like stdout in UTF-16 mode on Windows. I don't know if it's commonly used, nor it would impact Python. I never see a platform using UTF-16 or UTF-32 for standard streams.

----------

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


More information about the Python-bugs-list mailing list