Greetings, I've followed some of the discussion on the list concerning the problem of getting some Unicode characters to display properly. As suggested in a few messages, I've recompiled my python to link to Tcl/Tk8.5. I know this has succeeded, as running Tkinter._test() pops up a dialog confirming that I'm using 8.5. Unfortunately, there still seem to be problems displaying Unicode characters properly. The following snippet demonstrates (disclaimer: I'm not a Tkinter guru by any means)... import Tkinter root = Tkinter.Tk() w1 = Tkinter.Button(root, text=u"\u026E", font=("Lucida Grande",24)) w2 = Tkinter.Label(root, text=u"\u026E", font=("Lucida Grande",24)) w1.pack() w2.pack The Button displays the correct character (a digraph from the International Phonetic Alphabet), whereas the Label displays what looks like a Chinese kanji character...the same problem as in 8.4. Is there something I'm doing wrong? For the record, I'm running OSX 10.4.11 on a PPC Mac. Thanks for any advice or pointers, Fred.
Fred Mailhot wrote:
Greetings,
I've followed some of the discussion on the list concerning the problem of getting some Unicode characters to display properly. As suggested in a few messages, I've recompiled my python to link to Tcl/Tk8.5. I know this has succeeded, as running Tkinter._test() pops up a dialog confirming that I'm using 8.5.
Unfortunately, there still seem to be problems displaying Unicode characters properly. The following snippet demonstrates (disclaimer: I'm not a Tkinter guru by any means)...
import Tkinter root = Tkinter.Tk() w1 = Tkinter.Button(root, text=u"\u026E", font=("Lucida Grande",24)) w2 = Tkinter.Label(root, text=u"\u026E", font=("Lucida Grande",24)) w1.pack() w2.pack
The Button displays the correct character (a digraph from the International Phonetic Alphabet), whereas the Label displays what looks like a Chinese kanji character...the same problem as in 8.4.
Is there something I'm doing wrong?
The first thing that strikes me is an endian issue. You're asking for Unicode 026E, but Unicode 6E02 might be what you're getting (and it's in the CJK ideograph range). Is there an endian compiler flag you need to set when you recompile your python for linking to Tcl/Tk 8.5? Dave
*bump* 2008/8/18 Dave Opstad <dave.opstad@monotypeimaging.com>:
The first thing that strikes me is an endian issue. You're asking for Unicode 026E, but Unicode 6E02 might be what you're getting (and it's in the CJK ideograph range). Is there an endian compiler flag you need to set when you recompile your python for linking to Tcl/Tk 8.5?
Did some tests, it's not and endian thing. Has *anybody* gotten Unicode working on Macs with Tkinter Label or Text widgets? Any help is *much* appreciated... F.
participants (2)
-
Dave Opstad -
Fred Mailhot