[Tutor] symbol encoding and processing problem

Timmie timmichelsen at gmx-topmail.de
Wed Oct 17 13:43:33 CEST 2007


I tried your advice yesterday evening.

> And see if you get a ç.
I see this character.

from easygui import easygui
raw = unicode("121ø 55' 5.55''", 'utf-8')
=> gets a encoding error

raw = unicode("121ø 55' 5.55''", 'cp1250')
=> this works while coding on windows.
How do I make it work really crossplatform: On both Linux and Windows?

lines = raw.split(unicode('ø', 'cp1250'))
=> again work on windows

print lines
easygui.msgbox(raw)
=> prints a strange symbol instead of "°"

import Tkinker
Tkinter._test()
=> this test test the expected result.



More information about the Tutor mailing list