R. David Murray <rdmur...@bitdance.com> added the comment:

And of course tools can grep for "f...@bar.com": you can't use encoded words in 
an address, only in the display name.

However, it occurs to me that in fact the restriction applies only to phrases, 
so one could use a less restrictive character set in an unstructured header 
such as the Subject, and that would indeed be nice.  The old header folder 
(python 2.7 and python 3.x compat32 policy) can't do it, because they don't 
know anything about the syntax of the headers they fold, they just use a bunch 
of heuristics.  The new policies in python3, however, use a smarter folder from 
_header_value_parser, and that *does* have access to the full parse tree for 
the header, and so could make smart decisions about which character set to use 
for the encoded word encoding.

If you'd like to try your hand at a PR implementing this idea, I'll be happy to 
provide advice and do a review.  It's not going to be anywhere near as simple 
as the one line change you proposed here, though :)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32298>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to