Deutsch   English   Français   Italiano  
<mailman.166.1719227035.2909.python-list@python.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!fu-berlin.de!uni-berlin.de!not-for-mail
From: "Peter J. Holzer" <hjp-python@hjp.at>
Newsgroups: comp.lang.python
Subject: Tkinter and astral characters (was: Decoding bytes to text strings
 in Python 2)
Date: Mon, 24 Jun 2024 13:03:45 +0200
Lines: 50
Message-ID: <mailman.166.1719227035.2909.python-list@python.org>
References: <MPG.40dfb14de0110a999896df@news.eternal-september.org>
 <CAPTjJmpAYU2yxUhJd2mG4vkkK7JsViyF+7oat_Gw=AmfNi=A8g@mail.gmail.com>
 <mailman.159.1718991773.2909.python-list@python.org>
 <MPG.40e0d04661dcc7cf9896e0@news.eternal-september.org>
 <CAPTjJmrOfrz0RoYO9nhB+d+u7m0QLqYqfO2d4nSa4HG+LeLUdg@mail.gmail.com>
 <41260f11-89ae-433d-b44a-26c604b91356@mrabarnett.plus.com>
 <20240624110345.k5ojn4j5tmejwu6k@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="rpmpesvbppsggghb"
X-Trace: news.uni-berlin.de B8B/AePBEnq6yiedA0LYxwXltNI2svf3BhT2VKbshEag==
Cancel-Lock: sha1:XdJSb0cOcMOS8eCa6s4wqYoZI1o= sha256:MFA7xBoY4C1xr50wWoGiS3oN2YQznfhGObv/V7z9Up4=
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
 dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'content-
 type:multipart/signed': 0.05; '"hello': 0.07; 'tkinter': 0.07;
 '(python': 0.09; 'characters,': 0.09; 'content-type:application
 /pgp-signature': 0.09; 'filename:fname piece:asc': 0.09;
 'filename:fname piece:signature': 0.09;
 'filename:fname:signature.asc': 0.09; 'skip:x 10': 0.09; 'ubuntu':
 0.09; 'subject:Python': 0.12; '"creative': 0.16; '3.8,': 0.16;
 '__/': 0.16; 'challenge!"': 0.16; 'displayed': 0.16; 'from:addr
 :hjp-python': 0.16; 'from:addr:hjp.at': 0.16; 'from:name:peter j.
 holzer': 0.16; 'hjp@hjp.at': 0.16; 'holzer': 0.16; 'reality.':
 0.16; 'stross,': 0.16; 'subject:characters': 0.16; 'url-
 ip:212.17.106/24': 0.16; 'url-ip:212.17/16': 0.16; 'url:hjp':
 0.16; '|_|_)': 0.16; 'wrote:': 0.16; 'python': 0.16; 'instead':
 0.17; 'to:addr:python-list': 0.20; 'tried': 0.26; 'suspect': 0.26;
 "isn't": 0.27; 'sense': 0.28; 'default': 0.31; "doesn't": 0.32;
 'python-list': 0.32; 'but': 0.32; 'windows': 0.34; 'header:In-
 Reply-To:1': 0.34; 'display': 0.36; 'error,': 0.38; 'least': 0.39;
 'enough': 0.39; 'handle': 0.39; 'included': 0.61; 'received:212':
 0.62; 'received:userid': 0.66; 'shows': 0.67; 'back': 0.67;
 'smart': 0.67; 'url-ip:212/8': 0.69; 'received:at': 0.84;
 'subject: \n ': 0.84; 'warning': 0.84; 'oldest': 0.91; 'fall':
 0.95
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <41260f11-89ae-433d-b44a-26c604b91356@mrabarnett.plus.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
 <python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
 <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
 <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <20240624110345.k5ojn4j5tmejwu6k@hjp.at>
X-Mailman-Original-References: <MPG.40dfb14de0110a999896df@news.eternal-september.org>
 <CAPTjJmpAYU2yxUhJd2mG4vkkK7JsViyF+7oat_Gw=AmfNi=A8g@mail.gmail.com>
 <mailman.159.1718991773.2909.python-list@python.org>
 <MPG.40e0d04661dcc7cf9896e0@news.eternal-september.org>
 <CAPTjJmrOfrz0RoYO9nhB+d+u7m0QLqYqfO2d4nSa4HG+LeLUdg@mail.gmail.com>
 <41260f11-89ae-433d-b44a-26c604b91356@mrabarnett.plus.com>
Bytes: 5957


--rpmpesvbppsggghb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2024-06-24 01:14:22 +0100, MRAB via Python-list wrote:
> Tkinter in recent versions of Python can handle astral characters, at lea=
st
> 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

--=20
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

--rpmpesvbppsggghb
Content-Type: application/pgp-signature; name="signature.asc"

-----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/foBZP9I0WQ3Ch8PLNvd1RQQ3RBsi6BfSuxOk=
=ZZjs
-----END PGP SIGNATURE-----

--rpmpesvbppsggghb--