Tkinter / Unicode and UTF-8

Thomas pushcold at hotpop.foo
Wed Nov 19 17:42:52 EST 2003


I was used to pass Unicode strings to Tk widgets. IIRC, Tcl/Tk 
expects UTF-8 encoded strings, but Tkinter took care of that. 
This worked, as long as I was using Python/Tk on Red Hat 9 Linux
(and on earlier versions).

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).

Now I have some questions:

- Was Tkinter changed to behave like that? 
- Will it stay like that in the future?
- Isn't it strange, that you have to pass UTF-8 encoded strings
  to Tk widgets, but that the widgets will return Unicode strings?

(My versions: Python 2.2.3, Tkinter 2.2.3, Tcl/Tk 8.3.5)

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.

-- 
mailto: pushcold at hotpop.foo (where: foo = com)





More information about the Python-list mailing list