flanker icon indicating copy to clipboard operation
flanker copied to clipboard

Consistent use of Strict / Ignore / Replace for Encoding errors

Open pquerna opened this issue 10 years ago • 0 comments

For an example message:

https://gist.github.com/pquerna/b6025e307e82262fa04c/raw/c31c0e18568ccc0a9ad7df27989839be5a49b0f5/t.eml

It has non-ascii or utf8 characters in its Subject line.

This only causes an error on accessing the .subject property.

to_unicode in ./flanker/flanker/mime/message/headers/parsing.py does:

return unicode(val, 'utf-8', 'strict')

However other places that are trying to convert strings to utf8 will use ignore, for example flanker.utils.to_utf8.

pquerna avatar Nov 26 '13 00:11 pquerna