libgmail's (even latest CVS) function "_parsePage" is marking ALL strings coming from GMail as Unicode by prepending an "u" to the string, and it does it even for strings that are encoded in UTF-8.
For example, my name ("Raúl") comes from GMail as "Ra\xc3\xba\l", that is, encoded in UTF-8. This becomes u'Ra\xc3\xbal' in "_parsePage()", which means that it has been converted to u'RaÃºl'.
Later, libgmail does things like "whatever.decode('utf-8')", but that "whatever" is encoded like the u'RaÃºl' above, so the "decode()" call will generate an UnicodeDecodeError exception.
I don't know if GMail *always* returns its strings as UTF-8, so maybe the only fix is to get the encoding from the HTML headers sent by GMail :?
Log in to post a comment.