Tal Einat <taleinat+pyt...@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. It's not just that - Tk's Text widget is the indexing in the line itself wrong. In the string from Terry's example, which has 11 characters in a line including three smiley emojis, the can be fetch using t.get('1.1'), t.get('1.2') etc. through t.get('1.11'). t.get('1.12') returns '\n' since it is at or after the end of the line. So, as far as indexing is concerned, each of those emoji characters is treated as a single character. ---------- _______________________________________ 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