Make sure we convert back to proper charset
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 27 Jul 2010 23:57:01 +0000 (17:57 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 27 Jul 2010 23:57:22 +0000 (17:57 -0600)
framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php

index 5cbc16b..d07ebb1 100644 (file)
@@ -110,6 +110,9 @@ class Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Base
     {
         global $browser;
 
+        $charset = isset($options['charset'])
+            ? $options['charset']
+            : $this->_mimepart->getCharset();
         $strip_style_attributes = (!empty($options['inline']) &&
                                    (($browser->isBrowser('mozilla') &&
                                     ($browser->getMajor() == 4)) ||
@@ -136,7 +139,7 @@ class Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Base
 
         $this->_node($data, $data);
 
-        return $data->saveHTML();
+        return Horde_String::convertCharset($data->saveHTML(), $data->encoding, $charset);
     }
 
     /**