PythonWin and Norwegian characters.

Syver Enstad syver.enstad at sensewave.com
Fri Aug 11 15:00:10 EDT 2000


I tried to open a file in Pythonwin like this:

file = open("E:/Våre
dokumenter/Kode/Kunder/Cyberwatcher/CwSelection/UNITTESTS/UTConsumer/debug.x
ml")

But it won't work as pythonwin does something strange with the Norwegian
character å. IDLE has no problem with it. I guess it has something to do
with the difference between codepage 850 encodings and ANSI encodings of
norwegian characters, but I have never had any problems with it except with
DOS and Win32 Console applications.

Here's a strange example:
E:\VÃ¥re
dokumenter\Kode\Kunder\Cyberwatcher\CwSelection\UNITTESTS\UTConsumer\debug.x
ml
The above string was the result of pasting a normal norwegian string into
PythonWin and then copying it into IDLE.

The error message in the interactive window is:
No such file or directory: 'E:\\V\303\245re
dokumenter\\Kode\\Kunder\\Cyberwatcher\\CwSelection\\UNITTESTS\\UTConsumer\\
debug.xml'

It seems to me that what the fileopening function sees is the two rubbish
characters instead of the å.

Anyone one know about a fix to this problem?





More information about the Python-list mailing list