I have a problem reading some characters in python.
I have a csv file in UTF-8 format and I read, but when the script read:
Preußen Münster-Kaiserslautern II
I get this error:
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 515, in __call__
handler.get (* groups)
File "/Users/fermin/project/gae/cuotastats/controllers/controllers.py", line 50, in get
f.name = unicode (row [1])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range (128)
I tried using Unicode functions and converting a string to Unicode, but I did not find a solution. I tried to use sys.setdefaultencoding('utf8'), but that also does not work.
source
share