function messaging_htmlmail_parse_content in Messaging 7
1 call to messaging_htmlmail_parse_content()
- messaging_htmlmail_parse_attachment in messaging_htmlmail/
messaging_htmlmail.inc
File
- messaging_htmlmail/
messaging_htmlmail.inc, line 540 - Drupal Messaging Framework - Send_Method class file
Code
function messaging_htmlmail_parse_content($part) {
$content = $part['body'];
// Decode this part
if ($encoding = strtolower($part['headers']['Content-Transfer-Encoding'])) {
switch ($encoding) {
case 'base64':
$content = base64_decode($content);
break;
case 'quoted-printable':
$content = quoted_printable_decode($content);
break;
case '7bit':
// 7bit is the RFC default
break;
}
}
// Try to convert character set to UTF-8.
if (preg_match('/.*charset="?([^";]+)"?.*/', $part['headers']['Content-Type'], $m)) {
$content = drupal_convert_to_utf8($content, $m[1]);
//$content = iconv($m[1], 'utf-8', $content);
}
return $content;
}