您的字符串使用MIME标头的带引号的可打印格式编码。该
email.header模块为您处理:
>>> from email.header import depre_header>>> try:... string_type = unipre # Python 2... except NameError:... string_type = str # Python 3...>>> for part in depre_header('=?ISO-8859-1?Q?Certificado=5FZonificaci=F3n=5F2010=2Epdf?='):... depred = string_type(*part)... print(depred)...Certificado_Zonificación_2010.pdf


