我正在拉下一封电子邮件,其中包含英文、中文和日文。我正在使用 PHP/EZComponents 来执行此操作,但是某个日语字符没有通过,所以我正在切换到 php imap_* funcs 以查看它们是否可以工作。
这就是我下面的内容,以及我得到的输出。我需要以某种方式对此进行解码......我知道这已经在整个网络上得到了很好的(阅读:过度/混乱)记录,但我现在没有时间在这方面获得博士学位。任何帮助是极大的赞赏。
$hn='{imap.gmail.com:993/imap/ssl}INBOX';
$inbox = imap_open($hn,$username,$password,CL_EXPUNGE);
foreach($emails as $email_number) {
$ov = imap_fetch_overview($inbox,$email_number,0);
$msg = imap_fetchbody($inbox,$email_number,2);
var_dump($msg);
// doesnt work... .. but right idea?
// var_dump( utf8_decode($msg) );
}
部分输出:
<font face=3D"Arial"><span lang=3D"EN-US" style=3D"font-size:10.5pt"><br></=
span></font><font color=3D"navy" face=3D"MS Gothic"><span lang=3D"JA" style=
=3D"font-size:10.5pt">=CC=EC=9A=DD=A4=AC=A4=A4=A4=A4=A4=AB=A4=E9=A1=A2</spa=
n></font></p><p style=3D"margin-right:0pt;margin-bottom:12pt;margin-left:0p=
t">
<font color=3D"navy" face=3D"MS Gothic"><span lang=3D"JA" style=3D"font-siz=
e:10.5pt"><br></span></font></p><p style=3D"margin-right:0pt;margin-bottom:=
12pt;margin-left:0pt"><font color=3D"navy" face=3D"MS Gothic"><span lang=3D=
"JA" style=3D"font-size:10.5pt">xxend</span></font></p>