开发者

Translating IMAP body based on their encoding

开发者 https://www.devze.com 2022-12-12 07:30 出处:网络
From the manual, I know that there are 6 different transfer encoding in IMAP. At this point, I\'ve created this basic function:

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?


To translate your 8 bit binary to human readable, try this:

http://www.php.net/manual/en/function.quoted-printable-encode.php

0

精彩评论

暂无评论...
验证码 换一张
取 消