Sujet : Tkinter and astral characters (was: Decoding bytes to text strings in Python 2)
De : hjp-python (at) *nospam* hjp.at (Peter J. Holzer)
Groupes : comp.lang.pythonDate : 24. Jun 2024, 13:03:45
Autres entêtes
Message-ID : <mailman.166.1719227035.2909.python-list@python.org>
References : 1 2 3 4 5 6 7
Pièces jointes : signature.asc (application/pgp-signature) On 2024-06-24 01:14:22 +0100, MRAB via Python-list wrote:
Tkinter in recent versions of Python can handle astral characters, at least
back to Python 3.8, the oldest I have on my Windows PC.
I just tried modifying
https://docs.python.org/3/library/tkinter.html#a-hello-world-programto display "Hello World \N{ROCKET}" instead (Python 3.10.12 as included
with Ubuntu 22.04). I don't get a warning or error, but the emoji isn't
displayed either.
I suspect that the default font doesn't include emojis and Tk isn't
smart enough to fall back to a different font (unlike xfce4-terminal
which shows the emoji just fine).
hp
-- _ | Peter J. Holzer | Story must make more sense than reality.|_|_) | || | | hjp@hjp.at | -- Charles Stross, "Creative writing__/ | http://www.hjp.at/ | challenge!"