• Tkinter and astral characters (was: Decoding bytes to text strings in P

    From Peter J. Holzer@21:1/5 to MRAB via Python-list on Mon Jun 24 13:03:45 2024
    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-program
    to 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.
    |_|_) | |
    | | | [email protected] | -- Charles Stross, "Creative writing
    __/ | http://www.hjp.at/ | challenge!"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmZ5UowACgkQ8g5IURL+ KF2Idg/8Dqv939Ek0qDorvHZ8riwKhH2NlnGO8X6JD5KICCmWSl3A8i24rDj1Djt umfAT+y9JD7qK6IhWBVgkHFBIU4QfHTwpWjmZ3pPd88r3nieaQkkg4Gxg1a2uVZq zZZjoPl5v3Ssq3ECcGBD9aChzDRiupXibpksmqdWHIZboMg8eR/ZWANuoPRdk6aX 1e4AECf2zYWIM6lUsuddnuy+IctHP08nrCyGsf0fWmrNICuB+b69FYDUpo2eoXZ/ QjaQytqAd+NhdXqTq4BbTe9gRdhDi9k1AnOcPbAt16HRhGtFApuNMneJTqtu3VAA oOUfhrWH/mS++st+CiCXxoHNdQLITvkew0OohzXuc6PMJUYA0BUAY4etJ1Q3YySD 5qdLYUvZzmnPpCCSOtIET6cM5y1/3Oi2C7l7EJMdeJqoMubUDEyZSPNwulKvK96f pHEmF3mhfIUqpOdrC/bkZXszugAuhrP92YAUktfEEFl3qc/0hiQjQIN0Of9V3RHY 1jKe6aYYnqmRIBxhLabJX0CLo2oA9qo54gpMUoSAK8TlwN03pd6GTyFFzcwf50MX g501yI1bouHYYrkz6WoMgQYRJ5WHxCZnIeU6IcCzt1tXeOVqPLz5xWu0VZPYOsXR Cpw2WHhRqIZhSb/foBZP9I0WQ3Ch8PLNvd1RQQ3