#7 UnicodeDecodeError: 'utf8' codec can't decode byte 0xfc in p

open
nobody
None
5
2011-05-18
2011-05-18
herczeg3725
No

Hi,

1. compile pythonqt with python 2.6 and Qt 4.7.3
2. build the QuiExample
3. copy "python26.dll" and the "Lib" directory of your python 2.6 installation into the dir of PyGuiExample.exe
3. start PyGuiExample.exe
4. type:

py> unicode("aaa",'UTF-8').encode('UTF-8') == "aaa"
True

py> unicode("küne",'UTF-8').encode('UTF-8') == "küne"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\python\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xfc in position 1: invalid start byte

The problem happens too, if I'm using umlauts in code:
mainModule->evalScript(sScriptWithUmlauts);

How could this error be fixed?
(the line "# -*- coding: utf-8 -*-" doesn't help too)
Ciao

Discussion