Issue 24211: Add RFC 6532 support to the email library (original) (raw)

I could have sworn there was an issue for this already, but I couldn't find it.

Attached patch adds a utf8 policy knob and an SMTPUTF8 policy instance, and modifies BytesGenerator and the _header_value_parser to use that policy setting to generate utf8 headers instead of encoding non-ascii using encoded words. (I designed the new code to make it easy to support this RFC, but even I had no idea the patch would be so small. I hope I didn't miss anything.)

I will probably commit this tomorrow, since the deadline is looming.