diff options
author | R David Murray <rdmurray@bitdance.com> | 2011-04-06 13:35:57 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2011-04-06 13:35:57 (GMT) |
commit | 8debacb51c0a90828c671e2ea1d581e236e26b4b (patch) | |
tree | 49a178dfbea5b826839206e1b573f7dcd71b7160 /Doc | |
parent | a0b1c77a19ecfe58d34d10ba4b60f9bb4ad217f0 (diff) | |
download | cpython-8debacb51c0a90828c671e2ea1d581e236e26b4b.zip cpython-8debacb51c0a90828c671e2ea1d581e236e26b4b.tar.gz cpython-8debacb51c0a90828c671e2ea1d581e236e26b4b.tar.bz2 |
#1690608: make formataddr RFC2047 aware.
Patch by Torsten Becker.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/email.util.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/library/email.util.rst b/Doc/library/email.util.rst index f7b777a..4d96857 100644 --- a/Doc/library/email.util.rst +++ b/Doc/library/email.util.rst @@ -29,13 +29,20 @@ There are several useful utilities provided in the :mod:`email.utils` module: fails, in which case a 2-tuple of ``('', '')`` is returned. -.. function:: formataddr(pair) +.. function:: formataddr(pair, charset='utf-8') The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form ``(realname, email_address)`` and returns the string value suitable for a :mailheader:`To` or :mailheader:`Cc` header. If the first element of *pair* is false, then the second element is returned unmodified. + Optional *charset* is the character set that will be used in the :rfc:`2047` + encoding of the ``realname`` if the ``realname`` contains non-ASCII + characters. Can be an instance of :class:`str` or a + :class:`~email.charset.Charset`. Defaults to ``utf-8``. + + .. versionchanged: 3.3 added the *charset* option + .. function:: getaddresses(fieldvalues) |