[issue22999] Copying emoji to Windows clipboard corrupts string in Python 3.3 and up
Amaury Forgeot d'Arc
report at bugs.python.org
Fri Dec 5 11:32:39 CET 2014
Amaury Forgeot d'Arc added the comment:
(you swapped the unicode values: \U0001f4cb is copied as \U0001f400)
On Windows, strings have changed in 3.3. See in https://docs.python.org/3/whatsnew/3.3.html, "len() now always returns 1 for non-BMP characters".
The call to GlobalAlloc should use the number of wchar_t units, something like len(data.encode('utf-16')) + 2
----------
nosy: +amaury.forgeotdarc
resolution: -> not a bug
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22999>
_______________________________________
More information about the Python-bugs-list
mailing list