简体   繁体   中英

How to change the subject info of Gmail into Chinese character?

I got a string =?GB2312?B?zbO8xtGnu/m0ocq10bXP7sS/?= with $overview[0]->subject; in imap_fetch_overview function .

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.

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: 统计学基础实训项目

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM