handle utf-16 plain text attachments

This commit is contained in:
Klaus Leithoff 2011-11-10 15:07:38 +00:00
parent 047f07a8da
commit 135a4f6501

View File

@ -1476,7 +1476,6 @@ class felamimail_bo
'attachment' =>__METHOD__.' failed:'.$attachment->message
);
}
switch ($structure->encoding) {
case 'BASE64':
// use imap_base64 to decode
@ -1490,6 +1489,10 @@ class felamimail_bo
default:
// it is either not encoded or we don't know about it
}
if ($structure->type === 'TEXT' && isset($structure->parameters['CHARSET']) && stripos('UTF-16',$structure->parameters['CHARSET'])!==false)
{
$attachment = mb_convert_encoding($attachment,self::$displayCharset,$structure->parameters['CHARSET']);
}
$attachmentData = array(
'type' => $structure->type .'/'. $structure->subType,