【发布时间】:2011-04-30 21:43:07
【问题描述】:
我有一个 MIME 编码的消息(在 Maildir 中),它具有两个 base64 编码的标头(通过潜伏相关问题解决(Decode an UTF8 email header),解码('MIME-Header',$val),主体在纯文本和正文中的文本/纯 base64 编码数据中;
据说base64数据是用utf-8编码的。 但是,当我这样做时:
use MIME::Base4;
..
$decoded = decode_base64($block_from_line_array); # MIME body extracted from message's
$msgtext .= $decoded;
..
print decode('utf-8', $msgtext);
该块似乎解码错误。
print decode('utf-8', $msgtext); works ok, when message body is in utf-8
附上:
X-Priority: 3
X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.4]
X-Mailer: http://www.we.praise.buggy.php.scripts.what.we.do.when.we.dont.do.us
X-MessageID: 140
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_16819d4d69564bfc0185ed5b9508ad31"
<Here the body begins -- mhambra>
--b1_16819d4d69564bfc0185ed5b9508ad31
Content-Type: text/plain; charset = "utf-8"
Content-Transfer-Encoding: base64
<MIME BLOCK>
已知邮件可以在 GMail 中正确显示。
【问题讨论】: