On Mon, 12 Dec 2022 at 09:24, Barry Scott <ba...@barrys-emacs.org> wrote: > You would need to have a loop that collected all the utf-8 bytes of a single > code point. > You can to look at the first byte of know if the utf-8 is 1, 2, 3 or 4 bytes > for a code point.
And cope with escape sequences too - if you press an arrow key, for instance, you'll get a multi-character string to signal that. This is why it's probably easier to let someone else do the work. ChrisA -- https://mail.python.org/mailman/listinfo/python-list