from email.header import decode_header
print(decode_header("=?gbk?B?u+nJtA==?="))
print(decode_header("=?gbk?B?u+nJtA==?=")[0][0].decode("gbk"))
输出:
[(b'\xbb\xe9\xc9\xb4', 'gbk')]
婚纱
其他相应的包
import binascii
import email.quoprimime
import email.base64mime

本文展示了使用Python的email.header模块解码邮件头编码的具体方法,通过实例解析了GB2312编码的邮件主题。

1331

被折叠的 条评论
为什么被折叠?



