This bug must have been fixed between Python 2.2 + Tk 8.3 and Python 2.3
+ Tk 8.4.

Running a slightly different test program, I get this output on Fedora
Core 1 (Python 2.2 + Tk 8.3):
    '\xc2\xa3'
and this output on Fedora Core 2 (Python 2.3 + Tk 8.4):
    u'\xa3'

You could try defining a
    class UStringVar(Tkinter.StringVar):
        def get(self):
            return Tkinter.StringVar.get(self).decode("utf-8")
and using that instead.  This seemed to work on the FC1 system, at least
when LANG=en_US.UTF-8 -- this might depend on tcl's idea of the sytem
encoding, though.

Jeff

Test program:

from Tkinter import *
t = Tk(); t.withdraw()
s = StringVar(t)
s.set(u"\xa3")
print repr(s.get())
t.destroy()

Attachment: pgpw8LNphDXk9.pgp
Description: PGP signature

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to