Hi, I have a problem with unicode string in Pylons templates(Mako). I will print first char from my string encoded in UTF-8 and urllib.quote(), for example string 'Ćukasz':
${urllib.unquote(c.user.firstName).encode('latin-1')[0:1]} and I received this information: <type 'exceptions.UnicodeDecodeError'>: 'utf8' codec can't decode byte 0xc5 in position 0: unexpected end of data When I change from [0:1] to [0:2] everything is ok. I think it is because of unicode and encoding utf-8(2 bytes). How to resolve this problem? Best regards -- http://mail.python.org/mailman/listinfo/python-list