Tkinter / Unicode and UTF-8
Martin v. Löwis
martin at v.loewis.de
Thu Nov 20 15:00:22 EST 2003
Thomas <pushcold at hotpop.foo> writes:
> Now I switched to Fedora Core 1 Linux (where Python/Tk does not
> work without fixing it - but I described that in another thread)
> and I have to pass UTF-8 encoded strings to Tk widgets (i.e. I
> cannot directly pass Unicode strings any more).
Then you fixed it incorrectly.
> - Was Tkinter changed to behave like that?
No.
> - Will it stay like that in the future?
No, it wasn't even changed.
> - Isn't it strange, that you have to pass UTF-8 encoded strings
> to Tk widgets, but that the widgets will return Unicode strings?
You don't have to. It works just fine with Unicode strings.
> Thanks in advance for any comments and hints; I have to change
> a lot of code if passing UTF-8 encoded strings to Tk widgets
> is now the only way to do it. And before doing that, I would
> really like to know what the 'correct' way is.
Not change the code.
Regards,
Martin
More information about the Python-list
mailing list