根据编码转换 IMAP 正文
从手册中,我知道有 6 种不同的传输编码在 IMAP 中。
此时,我已经创建了这个基本函数:
function translate_imap_body($body, $encoding) {
switch($encoding) {
case 0: return $body;break;
case 1: return $body;break;
case 2: return $body;break;
case 3: return base64_decode($body);break;
case 4: return quoted_printable_decode($body);break;
case 5: return $body;break;
}
}
我的问题是,如何将 8 位、二进制和其他编码转换回人类可读的消息形式?或者,也许有人有更好的功能来处理这个问题?
From the manual, I know that there are 6 different transfer encoding in IMAP.
At this point, I've created this basic function:
function translate_imap_body($body, $encoding) {
switch($encoding) {
case 0: return $body;break;
case 1: return $body;break;
case 2: return $body;break;
case 3: return base64_decode($body);break;
case 4: return quoted_printable_decode($body);break;
case 5: return $body;break;
}
}
My question is, how do I translate 8bit, binary, and other encoding back to human readable message form? Or, maybe someone has better functions to handle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要将 8 位二进制文件转换为人类可读的格式,请尝试以下操作:
http ://www.php.net/manual/en/function.quoted-printable-encode.php
To translate your 8 bit binary to human readable, try this:
http://www.php.net/manual/en/function.quoted-printable-encode.php