7bit传输编码和UTF-7以及8bit和UTF-8之间可能的关系是什么?7位和8位编码信息必须在输出前解码吗?
是否有意义的手动转换消息正文编码为预期的(假设'utf-8')如下面的代码?
function decodeBody($body, $transferEncoding, $bodyEncoding) {
switch ($transferEncoding) {
case '7BIT' :
case '8BIT' :
// any additional decoding here ?
$body = mb_convert_encoding($body, 'utf-8', $bodyEncoding);
break;
case 'BASE64' :
$body = base64_decode($body);
$body = mb_convert_encoding($body, 'utf-8', $bodyEncoding);
break;
case 'QUOTED_PRINTABLE' :
$body = quoted_printable_decode($body);
$body = mb_convert_encoding($body, 'utf-8', $bodyEncoding);
break;
}
return $body;
}
你可能想要阅读的东西:http://www.joelonsoftware.com/articles/Unicode.html Quote:有一些名为UTF-7,这很像UTF-8,但保证高位会总是为零' –