Terry J. Reedy <tjre...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue41212>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to