Yet another problem with special characters (Ä, Ö, Ü, etc.)

Dominik Reiter dominik.reiter at epost.de
Tue Oct 8 17:02:04 EDT 2002


Hi everybody,

I'm trying to implement a CGI-script, which takes information from a
HTML-Form and passes this information into a database. I get the
information from the form just fine and the connection to the database
also works. But when I do the INSERT-statement and one of the fields
contains a German Umlaut (like 'Ö' for example), all I get in the
database is \xd6 (for Ö). So if I want to insert 'Österreich' I get
'\xd6sterreich'.
If I try this with IDLE or the Shell in PythonWin, it's like this:

>>> val = 'Ö'
>>> print val
Ö
>>> val
'\xd6'

I've implemented the sitecustomize.py and the changing of the default
encoding works just fine, but the results to my problem are still the
same. I've tried  several different encodings but none worked.

Does anybody have an idea as to what I can do to make this work?

My environment is:
Win2000 Pro
Python 2.2
IIS
MySQL

Any help is appreciated

Dominik



More information about the Python-list mailing list