我有一個MIME編碼的消息(在Maildir中),它們都具有base64編碼的頭文件(通過潛伏相關問題解決(Decode an UTF8 email header),decode('MIME-Header',$ val ),主體以純文本和身體編碼數據的文本/無格式的base64;Perl/MIME編碼的文本錯誤
據說,該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中正確顯示。