469,328 Members | 1,294 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

iso_8859_1 mystery/tkinter

These work fine on Linux
s.const = {}
s.const['DEG'] = '%c' % (0xb0)
s.const['DIV'] = '%c' % (0xf7)
s.const['ANG'] = '%c' % (0xd8)

On WinXP the symbols for division and angle work fine.
But the symbol for degrees, a little circle, produces
a vertical bar in Tkinter Text box or Canvas.

However, if I run from IDLE and output to a console
window, 0xb0 produces the correct character for degrees.
Any idea why?
Thanks

Jul 19 '05 #1
4 1257
phil wrote:
These work fine on Linux
s.const = {}
s.const['DEG'] = '%c' % (0xb0)
s.const['DIV'] = '%c' % (0xf7)
s.const['ANG'] = '%c' % (0xd8)

On WinXP the symbols for division and angle work fine.
But the symbol for degrees, a little circle, produces
a vertical bar in Tkinter Text box or Canvas.


I don't understand what you mean by that. Do you have
the symbol for degrees in your source code (so that
the editor for the source code displays it as a little
circle)? Or do you use the numeric code?

Can you show a small program that demonstrates this
effect?

Regards,
Martin

Jul 19 '05 #2
phil wrote:
These work fine on Linux
s.const = {}
s.const['DEG'] = '%c' % (0xb0)
s.const['DIV'] = '%c' % (0xf7)
s.const['ANG'] = '%c' % (0xd8)

On WinXP the symbols for division and angle work fine.
But the symbol for degrees, a little circle, produces
a vertical bar in Tkinter Text box or Canvas.


I don't understand what you mean by that. Do you have
the symbol for degrees in your source code (so that
the editor for the source code displays it as a little
circle)? Or do you use the numeric code?

Can you show a small program that demonstrates this
effect?

Regards,
Martin
Jul 19 '05 #3

""Martin v. Lwis"" <ma****@v.loewis.de> schrieb im Newsbeitrag
news:ma*************************************@pytho n.org...
| phil wrote:
| > These work fine on Linux
| > s.const = {}
| > s.const['DEG'] = '%c' % (0xb0)
| > s.const['DIV'] = '%c' % (0xf7)
| > s.const['ANG'] = '%c' % (0xd8)
| >
| > On WinXP the symbols for division and angle work fine.
| > But the symbol for degrees, a little circle, produces
| > a vertical bar in Tkinter Text box or Canvas.
|
| I don't understand what you mean by that. Do you have
| the symbol for degrees in your source code (so that
| the editor for the source code displays it as a little
| circle)? Or do you use the numeric code?
|
| Can you show a small program that demonstrates this
| effect?

OP probably means something like:

import Tkinter
root = Tkinter.Tk()
t = Tkinter.Text()
t.pack()
t.insert(0.0, '%c' % 0xb0)
root.mainloop()

which shows a vertical bar in the Text widget.

Changing:

t.insert(0.0, '%c' % 0xb0)

to

t.insert(0.0, u'%c' % 0xb0)
should do the trick though.

--

Regards,

Vincent Wehren

|
| Regards,
| Martin
|
Jul 19 '05 #4
| > s.const['DEG'] = '%c' % (0xb0) | > But the symbol for degrees, a little circle, produces
| > a vertical bar in Tkinter Text box or Canvas.
t.insert(0.0, u'%c' % 0xb0)

should do the trick though.


COOL! Thanks, though that seems a little odd.
As far as I know %c ignores the sign bit everywhere
else, including X11 and Win consoles.
But I'll just note it and do it.
Thanks again.

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by srijit | last post: by
7 posts views Thread by SeeBelow | last post: by
1 post views Thread by syed_saqib_ali | last post: by
reply views Thread by syed_saqib_ali | last post: by
1 post views Thread by Michael Yanowitz | last post: by
3 posts views Thread by dwelch91 | last post: by
8 posts views Thread by karthikbalaguru | last post: by
3 posts views Thread by joshdw4 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.