Umlauts, encodings, sitecustomize.py

Helmut Jarausch jarausch at skynet.be
Tue Nov 9 17:15:05 CET 2004


F. GEIGER wrote:
> I'm on WinXP, Python 2.3.
> 
> I don't have problems with umlauts (ä, ö, ü and their uppercase instances)
> in my wxPython-GUIs, when displayed as static texts. But when filling
> controls with text containing umlauts, or in the Python console, or when
> writing to files umlauts are escaped:
> 
> Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
> 
>>>>"ä"
> 
> '\x84'
> 
> 
> I have defined a sitecustomize.py with these lines in it
> 
> import sys
> sys.setdefaultencoding("iso-8859-1")
> 
> What else do I have to adjust?

Try the line
# _*_ coding: latin1 _*_

at the very beginning (or at least after a #! line on Unix)
This works under Linux, at least.

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany



More information about the Python-list mailing list