Message373495
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. |
|
Date |
User |
Action |
Args |
2020-07-11 01:44:58 | terry.reedy | set | recipients:
+ terry.reedy, ronaldoussoren, ned.deily, Ben Griffin, epaine |
2020-07-11 01:44:57 | terry.reedy | set | messageid: <1594431897.94.0.337684997344.issue41212@roundup.psfhosted.org> |
2020-07-11 01:44:57 | terry.reedy | link | issue41212 messages |
2020-07-11 01:44:56 | terry.reedy | create | |
|