it works fine on 64 bit machines but for some reason will not work on python 2.4.3 on a 32-bit instance.
i get the error
'utf8' codec can't decode bytes in position 76-79: invalid data
for the code
try:
str(sourceresult.sourcename).encode('utf8','replace')
except:
raise Exception( repr(sourceresult.sourcename ) )
it returns ‘kazamidori blog\xf9’
i have modified my site.py file to make UTF8 the default encoding, but still doesnt seem to be working.
We need the following, and we need the exact output:
Like I said, I’m almost certain that your
sourceresult.sourcenameis already a UTF-8 encoded string.Perhaps this might help a little.
EDIT: it seems your
sourceresult.sourcenameis encoded as cp1252. I don’t know whatmystring(that you reference in a comment) is.So, to get a UTF-8 encoded string, you need to do:
However, the string being cp1252-encoded is not consistent with the error message you supplied.