#1368247: make set_charset/MIMEText automatically encode unicode _payload.
Fixes (mysterious, to the end user) UnicodeErrors when using utf-8 as
the charset and unicode as the _text argument. Also makes the way in
which unicode gets encoded to quoted printable for other charsets more
sane (it only worked by accident previously). The _payload now is encoded
to the charset.output_charset if it is unicode.
diff --git a/Doc/library/email.mime.rst b/Doc/library/email.mime.rst
index 10f3e37..a092feb 100644
--- a/Doc/library/email.mime.rst
+++ b/Doc/library/email.mime.rst
@@ -191,9 +191,11 @@
minor type and defaults to :mimetype:`plain`. *_charset* is the character
set of the text and is passed as a parameter to the
:class:`~email.mime.nonmultipart.MIMENonMultipart` constructor; it defaults
- to ``us-ascii``. No guessing or encoding is performed on the text data.
+ to ``us-ascii``. If *_text* is unicode, it is encoded using the
+ *output_charset* of *_charset*, otherwise it is used as-is.
.. versionchanged:: 2.4
- The previously deprecated *_encoding* argument has been removed. Encoding
- happens implicitly based on the *_charset* argument.
+ The previously deprecated *_encoding* argument has been removed. Content
+ Transfer Encoding now happens happens implicitly based on the *_charset*
+ argument.