CSS Compressor convert mess up hebrew text encoding and no email client can't read it.
mimemail_compress.inc line 68-74
if (function_exists('mb_detect_encoding') && function_exists('mb_convert_encoding')) {
$encoding = mb_detect_encoding($body);
if ($encoding) {
$body = mb_convert_encoding($body, 'HTML-ENTITIES', $encoding);
$doc->encoding = $encoding;
}
}
Original text:
כשדגכשדכג
Converted to:
©©
mb_detect_encoding($body) returns "ISO-8859-8"
however the $body is in UTF-8
Tried the following
if (function_exists('mb_detect_encoding') && function_exists('mb_convert_encoding')) {
$encoding = mb_detect_encoding($body);
if ($encoding) {
$body = mb_convert_encoding($body, 'HTML-ENTITIES', <strong>"UTF-8"</strong>);
$doc->encoding = $encoding;
}
}
Works great, now its returning the good text.
Comments
Comment #1
sgabe commentedSince Drupal uses UTF-8, I think it's safe to remove the encoding detection after all and use that for converting.
Comment #2
sgabe commentedCommitted.