email package vs. mimify.mime_encode_header
Ilpo Nyyssönen
iny+news at iki.fi
Sun Oct 19 05:06:49 EDT 2003
Tim Roberts <timr at probo.com> writes:
>>From my point of view this looks like dropping an important feature. I
>>really do not want to encode an ascii only header, but if the encoding
>>is needed, it needs to be there. With mimify this is handled
>>automatically, with Header I would need to do that by hand.
>
> You OUGHT to be doing it by hand in both cases. You'll need to parse the
> name anyway to get the addresses for SMTP.
OK, that might be true, but lets look the actually encoded parts:
Python 2.3.2 (#1, Oct 11 2003, 11:13:40)
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mimify
>>> mimify.mime_encode_header('This is an ascii only header')
'This is an ascii only header'
>>> from email.Header import Header
>>> Header('This is an ascii only header', 'iso-8859-1').encode()
'=?iso-8859-1?q?This_is_an_ascii_only_header?='
Encoding that is unnecessary. It is harder to read that as raw without
decoding.
It will cause problems in programs that do something automatically,
but do not decode it. A good example is filtering that is done based
on subject prefixes.
>From my point of view the encoding done by the Header is unusable.
--
Ilpo Nyyssönen # biny # /* :-) */
More information about the Python-list
mailing list