Comment 25 for bug 587745

Revision history for this message
Olivier Tilloy (osomon) wrote :

Instead of manually extracting the odd characters of the string encoded as UTF-16, a cleaner solution is to do something like that:

    value.decode('utf-16')

For instance the value of Exif.Image.XPComment in comment #22 would be 'C\x00o\x00m\x00m\x00e\x00n\x00t\x00a\x00i\x00r\x00e\x00 \x00w\x00i\x00n\x00d\x00o\x00w\x00s\x007\x00'. If you apply .decode('utf-16') on this string, you get u'Commentaire windows7'.