[issue41212] Emoji Unicode failing in standard release of Python 3.8.3 / tkinter 8.6.8

Terry J. Reedy report at bugs.python.org
Fri Jul 10 21:44:57 EDT 2020


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Python internally uses an encoding system that represents all unicode chars efficiently, including O(1) indexing.  It is not utf-8, which does not do O(1) indexing.

There is already an issue about upgrading (separately) the Python Windows and macOS installers to install tcl/tk 8.6.9.

With the currrent 8.6.9 and probably earlier, and since an important tkinter patch last fall for #13153, a tkinter/tk text widget will display astral characters that the font in use can produce.  For example, in 3.9.0, I see the TV set printed in IDLE
>>> '\U0001f4bb'
'💻'
but not in the Windows Console Python REPL, which shows 'box space box box'.

However, astral characters discombobutate editing (#39126),at least on Windows, they are counted as 2 or 4 chars.  The difference between behavior before and after Serhiy's patch and between display and editing likely explains different reports on SO.

----------
nosy: +terry.reedy
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41212>
_______________________________________


More information about the Python-bugs-list mailing list