[Tutor] symbol encoding and processing problem

Kent Johnson kent37 at tds.net
Wed Oct 17 14:58:05 CEST 2007


Timmie wrote:

>> Get an editor on Windows that can edit UTF-8 text files and file 
>> transfer software that doesn't change the text encoding. Work with UTF-8 
>> exclusively.
> Thanks. This sounds really trivial but the thing is that one cannot define file
> encoding in PythonWin.

Really! That is surprising. Anyone else know how to set the file 
encoding for the PythonWin editor?

> Since it didn't work in IPython as well I assume that I need to change the
> encoding of the IPython shell to UTF-8, too. Still need to find out where.

Was the problem with the print statements? Maybe changing the console 
encoding would help. I have some notes here:
http://personalpages.tds.net/~kent37/stories/00018.html

> The following code works on windows when saved to a UTF-8 encoded file:
> 
> # -*- coding: utf-8 -*-
> # the file needs to be set to UTF-8 encoding if working on windows
> from easygui import easygui
> raw = unicode("125° 15' 5.55''", 'utf-8')

Again, I think this can be simplified to
   raw = u"125° 15' 5.55''"

Kent


More information about the Tutor mailing list