[Tkinter-discuss] ttk.Label unicode characters

Michael Lange klappnase at web.de
Mon Jan 21 17:56:37 EST 2019


On Mon, 21 Jan 2019 13:00:52 -0500
Ben <bcail at speedymail.org> wrote:

> Thanks so much for your replies!
> Here's my little test script, with trying what you wrote, and the
> results I got (all on python 3): import tkinter as tk
> from tkinter import ttk
> root = tk.Tk()
> l = ttk.Label(root)
> l.grid(row=0, column=0)
> text = 'Test \U0001d306 String'
> #l.configure(text=text)
> #  Result: _tkinter.TclError: character U+1d306 is above the range (U
> # +0000-U+FFFF) allowed by Tcl
> #l.configure(text=text.encode('utf8'))
> #  Result: no exception, but wrong characters show up
> l.tk.eval(l._w + f' configure -text  "{text}"')
> #  Result: works!

the same here.

> So, tkinter maintainers, would there be a way to build this into
> tkinter, so it transparently handles all unicode characters?

I tried to investigate a bit further and found this thread which seems
to more or less address this issue:


It looks like the Tkinter maintainers are waiting for Tk 9.0 to come to
life which is supposed to introduce full unicode support.
There seem also to be some issues with different systems not behaving
exactly alike.

I also found a thread where a couple of workarounds are suggested:


however none of these seem to work here 😞

> If so,
> would there be interest in patches for it?

Of course you can try.
Personally I would not bother (even if I had the skills to provide a
patch :)



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Lots of people drink from the wrong bottle sometimes.
		-- Edith Keeler, "The City on the Edge of Forever",
		   stardate unknown

More information about the Tkinter-discuss mailing list