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.

CommentFileSizeAuthor
#1 mimemail_1260302_01.patch933 bytessgabe

Comments

sgabe’s picture

Priority: Critical » Normal
Status: Active » Needs review
StatusFileSize
new933 bytes

Since Drupal uses UTF-8, I think it's safe to remove the encoding detection after all and use that for converting.

sgabe’s picture

Title: CSS Compressor convert mess up hebrew text encoding » Replace encoding detection with UTF-8 in CSS Compressor
Version: 6.x-1.0-beta2 » 6.x-1.x-dev
Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.