Trees | Indices | Help |
|
---|
Header encoding and decoding functionality.
'
'
)'
\n
'
'
'
u'
'
'
'
u'
'
76
us-ascii
utf-8
re.compile(r'(?ix)
=\?(?P<
charset
>
[^
\?]
*?
)
\?(?P<
encoding
...
re.compile(r'[
!-
~]
+
:$')
Imports: re, binascii, email, HeaderParseError, Charset, _max_append
Decode a message header value without converting charset.
Returns a list of (decoded_string, charset) pairs containing each of the decoded parts of the header. Charset is None for non-encoded parts of the header, otherwise a lower-case string containing the name of the character set specified in the encoded string.
An email.Errors.HeaderParseError may be raised when certain decoding error occurs (e.g. a base64 decoding exception).
'
'
)
Create a Header from a sequence of pairs as returned by decode_header()
decode_header() takes a header value string and returns a sequence of pairs of the format (decoded_string, charset) where charset is the string name of the character set.
This function takes one of those sequence of pairs and returns a Header instance. Optional maxlinelen, header_name, and continuation_ws are as in the Header constructor.
re.compile(r'(?ix)
=\?(?P<
charset
>
[^
\?]
*?
)
\?(?P<
encoding
>
[
qb]
)
\?(?P<
enc
\oded
>
.*?
)
\?=')
Trees | Indices | Help |
|
---|