I got a string =?GB2312?B?zbO8xtGnu/m0ocq10bXP7sS/?= with $overview[0]->subject; in imap_fetch_overview function .
=?GB2312?B?zbO8xtGnu/m0ocq10bXP7sS/?=
$overview[0]->subject;
imap_fetch_overview
How to change the subject info of Gmail into Chinese character?
Your string is a MIME RFC 2047 encoded word which can be decoded using PHP's mb_decode_mimeheader and mb_internal_encoding functions.
mb_decode_mimeheader
mb_internal_encoding
To convert your MIME encoded string to UTF-8, you can use the following code:
mb_internal_encoding('UTF-8'); echo mb_decode_mimeheader('=?GB2312?B?zbO8xtGnu/m0ocq10bXP7sS/?='); # result: 统计学基础实训项目
Your string is a MIME RFC 2047 encoded word which can be decoded using PHP's
mb_decode_mimeheader
andmb_internal_encoding
functions.To convert your MIME encoded string to UTF-8, you can use the following code: