character set gobbledy-gook ascii translation ...

Jeff Epler jepler at unpythonic.net
Fri Dec 24 09:40:56 EST 2004


>>> email.Header.decode_header("=?us-ascii?Q?Re=3A=20=5Bosg=2Duser=5D=20Culling=20problem?=")
[('Re: [osg-user] Culling problem', 'us-ascii')]
>>> email.Header.decode_header("=?gb2312?B?cXVlc3Rpb24gYWJvdXQgbG9hZGluZyBmbHQgbGFyZ2UgdGVycmFpbiA=?=")
[('question about loading flt large terrain ', 'gb2312')]
>>> help(email.Header.decode_header)
Help on function decode_header:

decode_header(header)
    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).

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20041224/06fb63ef/attachment.sig>


More information about the Python-list mailing list