2012-09-21 139 views

回答

11

您的字符串使用Quoted-printable格式爲MIME標頭進行編碼。 email.header module爲您處理:

>>> from email.header import decode_header 
>>> bytes, encoding = decode_header('=?utf-8?Q?12_=D7=A1=D7=91=D7=99=D7=97?=')[0] 
>>> print bytes.decode(encoding) 
12 סביח 
+0

OMG謝謝!過去一個月我一直在尋找這個答案。優秀!謝謝 – newyuppie

相關問題