Message89488
decode_header only accepts str as input. If the input contains no
encoded words, the output is str (ie: the input string) and None. If it
does contain encoded words, the output is pairs of bytes plus str
charset identifiers (or None). This makes it difficult to use this
function to decode headers, since one has to test for the special case
of str output when there are no encoded words.
I think decode_header should take bytes as input, and output (bytes.
str) pairs consistently.
In any case, the documentation is wrong since it says it returns
strings. The example is also wrong, since the actual output is:
[(b'p\xf6stal', 'iso-8859-1')] |
|
Date |
User |
Action |
Args |
2009-06-18 01:36:16 | r.david.murray | set | recipients:
+ r.david.murray |
2009-06-18 01:36:16 | r.david.murray | set | messageid: <1245288976.09.0.298419063758.issue6302@psf.upfronthosting.co.za> |
2009-06-18 01:36:14 | r.david.murray | link | issue6302 messages |
2009-06-18 01:36:14 | r.david.murray | create | |
|