email: Decode headers when checking .as_string() flatten fallback
authorW. Trevor King <wking@tremily.us>
Sun, 17 Feb 2013 15:49:41 +0000 (10:49 -0500)
committerW. Trevor King <wking@tremily.us>
Sun, 17 Feb 2013 16:28:44 +0000 (11:28 -0500)
commite08e198b2a0cb9c841a4a93ad720d70077ec9a8f
tree6377f8822c8ca37945ff049a717d2263848f63eb
parent1c97270ee6d5d0cdb79cd025c17689fd342890bd
email: Decode headers when checking .as_string() flatten fallback

A naive dict-comparison fails if any header fields are encoded
following RFC 2047.  For example,

  '=?iso-8859-1?q?this=20is=20some=20text?='

will not compare equal to an email.header.Header instance.  By
decoding everything to Unicode strings before comparing the header
fields, we can see if the underlying data matches.

Signed-off-by: W. Trevor King <wking@tremily.us>
rss2email/email.py