How can I display unicode in Tk widget

Martin v. Loewis martin at v.loewis.de
Sun Dec 30 09:24:51 EST 2001


"Kick" <store_li at sina.com> writes:

> Could someone help me?

With the code you have given, it is still difficult to understand your
problem: You fetch the string from the database, but we do not know
what the string is. Could you please modify your program to print the
type and value of f, then modify it to use the value literally,
i.e. without any use of SQLite.

Or, to try this vice versa, please execute the program

import Tkinter
l = Tkinter.Label(text=u"\u5321")
l.pack()
l.tk.mainloop()

on your system. On my system (Python 2.2 on Windows XP), it displays a
window with a single Chinese character (which I picked arbitrarily,
since I don't speak Chinese). What does that very program do on your
system? If it fails, which Python version and Windows version are you
using?

Regards,
Martin



More information about the Python-list mailing list