diff options
author | Barry Warsaw <barry@python.org> | 2003-08-19 04:26:59 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2003-08-19 04:26:59 (GMT) |
commit | 463c5a868fc6231029ab0890ea03d60fcc9a74e1 (patch) | |
tree | 9aa9cd195f511b43c647592d930b376a06af2471 /Doc | |
parent | c86c24e44d11d58acc7c7bc149e5a1cd7aed6c00 (diff) | |
download | cpython-463c5a868fc6231029ab0890ea03d60fcc9a74e1.zip cpython-463c5a868fc6231029ab0890ea03d60fcc9a74e1.tar.gz cpython-463c5a868fc6231029ab0890ea03d60fcc9a74e1.tar.bz2 |
Update get_param() description to reflect changes to the docstring.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/emailmessage.tex | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Doc/lib/emailmessage.tex b/Doc/lib/emailmessage.tex index f580edf..372c539 100644 --- a/Doc/lib/emailmessage.tex +++ b/Doc/lib/emailmessage.tex @@ -354,15 +354,18 @@ instead of \mailheader{Content-Type}. Parameter keys are always compared case insensitively. The return value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of -the form \code{(CHARSET, LANGUAGE, VALUE)}, where \code{LANGUAGE} may -be the empty string. Your application should be prepared to deal with -3-tuple return values, which it can convert to a Unicode string like -so: +the form \code{(CHARSET, LANGUAGE, VALUE)}. Note that both \code{CHARSET} and +\code{LANGUAGE} can be \code{None}, in which case you should consider +\code{VALUE} to be encoded in the \code{us-ascii} charset. You can +usually ignore \code{LANGUAGE}. + +Your application should be prepared to deal with 3-tuple return +values, and can convert the parameter to a Unicode string like so: \begin{verbatim} param = msg.get_param('foo') if isinstance(param, tuple): - param = unicode(param[2], param[0]) + param = unicode(param[2], param[0] or 'us-ascii') \end{verbatim} In any case, the parameter value (either the returned string, or the |