[Tutor] symbol encoding and processing problem

Timmie timmichelsen at gmx-topmail.de
Wed Oct 17 15:05:17 CEST 2007


OK, I found out.
> 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.
Put a file called 'sitecustomize.py' into any directory on your PYTHONPATH.

write the folowing two lines in that file:

import sys
sys.setdefaultencoding('utf-8')

To test, start ipython and type

import sys
sys.getdefaultencoding()

It should be utf-9 now.

Again, may sound trivial. for some. But I started my Python adventures on Ubuntu
Linux which it set to UTF-8 as default encoding. Due to some software
environments I am currently forced to use Windows. After installing Python and
some modules with setup.exe I never new that I even have to care for this...



More information about the Tutor mailing list