User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 402,573 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,383 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums

Help needed for displaying extended charactors in Tk()

Join Date: Jan 2006
Posts: 218
Reputation: katharnakh is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 19
katharnakh's Avatar
katharnakh katharnakh is offline Offline
Posting Whiz in Training

Re: Help needed for displaying extended charactors in Tk()

  #7  
Apr 2nd, 2007
Originally Posted by dav_yip View Post
Thanks for the advice. It seems that I have to spend more time in encoding to get this to work.

The strange thing that I do not understand is when I do the below it is ok.

>>> text = "itself ‘a parody’."
>>> print text
itself ‘a parody’.

But when I display via Tkinter I will have a difference result like " itself ムa parodyメ.".

To me it is really strange that even a print statment can manage the characters but not via Tkinter...

Well even i am not quite sure about it. But Tkinter is a Python module for GUI. It is object-oriented layer on top of Tcl/Tk.

Tcl is a scripting language which comes with graphical extension called Tk. Through so called “bindings”, Tk can be used under other languages, such as Perl, Python, and Ruby.

And python installation packages available in forms, i.e, ansi and unicode. If you have used unicode format, then your IDE will print what you said above. Because it uses utf-8 as its default encoding.

So when used with Tkinter, undelying Tcl/Tk might interpret differently.

someone correct me if i am wrong somewhere..

thank you,
kath.
challenge the limits
Reply With Quote  
All times are GMT -4. The time now is 10:37 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC