Serhiy Storchaka added the comment: >>> ('\udcff' + 'qwerty').encode('utf-16le', 'surrogateescape') b'\xff\xdcq\x00w\x00e\x00r\x00t\x00y\x00' >>> ('\udcff' + 'qwerty').encode('utf-16le', >>> 'surrogateescape').decode('utf-16le', 'surrogateescape') '\udcff\udcdcqwerty' >>> ('\udcff' + 'qwerty').encode('utf-16le', >>> 'surrogateescape').decode('utf-16le', 'surrogateescape').encode('utf-16le', >>> 'surrogateescape') b'\xff\xdc\xdc\xdcq\x00w\x00e\x00r\x00t\x00y\x00' >>> ('\udcff' + 'qwerty').encode('utf-16le', >>> 'surrogateescape').decode('utf-16le', 'surrogateescape').encode('utf-16le', >>> 'surrogateescape').decode('utf-16le', 'surrogateescape') '\udcff\udcdc\udcdc\udcdcqwerty'
---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18713> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com