PythonWin and Norwegian characters.

Neil Hodgson neilh at scintilla.org
Fri Aug 11 22:52:49 EDT 2000


   You may want to turn off Unicode processing in PythonWin. Open
Pythonwin\pywin\scintilla\view.py, find the OnInitialUpdate method and
comment out the two lines under "# Enable Unicode if we can". Save the file,
shut down Pythonwin and restart it and you may prefer the results.

> 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.

   PythonWin 132 (its always a good idea to mention the version number when
reporting a problem) uses code page 65001 which is UTF-8, as do recent
versions of IDLE.

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

   Once you allow Unicode a toe-hold in a system, it starts expanding to
require use in all situations. With 1.6 it looks like open can not take a
Unicode string for the file name - not that this would work automatically in
your case. It would be nice to be able to say

f = open(unicode('a unicode file name'),'utf-8'))

> Anyone one know about a fix to this problem?

   The above is a work-around. Some day this will have to be done right. I
don't know how to define "right" yet.

   Neil






More information about the Python-list mailing list