[wxPython-users] There is a textfile on my system that is unloadable in stc ?

David Woods dwoods at wcer.wisc.edu
Sun Dec 3 05:26:08 PST 2006


> There is a textfile on my system that is unloadable in stc ?
> 
> For example with pype :
> 
> [ Sun Dec 03 13:59:05 2006 ] Traceback (most recent call last):
>   File "pype.py", line 1456, in OnDrop
>   File "pype.py", line 1994, in newTab
>   File "pype.py", line 3667, in SetText
>   File "wx\stc.pyc", line 2842, in SetText
>   File "encodings\cp1252.pyc", line 22, in decode
> UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position
> 4031: character maps to <undefined>

Your file contains Unicode characters.  You are trying to load it when your
encoding is set to cp1252, which does not support the Unicode character(s)
in your file.

http://wiki.wxpython.org/index.cgi/UnicodeDecodeError

You need to be using the Unicode version of wxPython, if you're not already,
and change your system encoding to match the encoding in your text file or
change the encoding of the string you're loading.

http://wiki.wxpython.org/index.cgi/UnicodeBuild

Welcome to the larger world of dealing with languages other than English.

David





More information about the wxpython-users mailing list