Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
It is partially an IDLE issue. The code expects that indices in Python string correspond indices in Tcl string, but this is not true in case of astral characters which are encoded as 2 (or maybe even 4) characters in Tcl. To fix it we need to translate between Python and Tcl indices every time when we pass indices from one language to other. It is virtually impossible to do in general (in Tkinter code) because there are tons of methods which return or accept indices. It can be fixed in IDLE specifically, but it is still a lot of work. I'll try to fix at least some code (backspace and highlighting). And every Tkinter application which works with string indices and lengths and can support astral characters should fix it separately. It can help if helper function for conversion between indices in IDLE be exposed as public API in Tkinter. On other hand, the problem will gone in Tcl/Tk 8.7 or 9.0. So we can just wait several years. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44217> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com