Fix charset when converting with html2text
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 30 Nov 2009 18:10:33 +0000 (11:10 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 30 Nov 2009 18:27:42 +0000 (11:27 -0700)
imp/ajax.php
imp/compose.php
imp/lib/Mime/Viewer/Html.php
imp/stationery.php

index f4eff0c..d169414 100644 (file)
@@ -570,7 +570,7 @@ case 'Html2Text':
     $result = new stdClass;
     // Need to replace line endings or else IE won't display line endings
     // properly.
-    $result->text = str_replace("\n", "\r\n", Horde_Text_Filter::filter(Horde_Util::getPost('text'), 'html2text'));
+    $result->text = str_replace("\n", "\r\n", Horde_Text_Filter::filter(Horde_Util::getPost('text'), 'html2text', array('charset' => Horde_Nls::getCharset())));
     break;
 
 case 'Text2Html':
index a8c11a6..61bfba6 100644 (file)
@@ -674,7 +674,7 @@ if (!is_null($oldrtemode) && ($oldrtemode != $rtemode)) {
                            array('<p>&nbsp;</p>', '<p class="imp-signature"><!--begin_signature-->' . $imp_compose->text2html($sig) . '<!--end_signature--></p>'),
                            $msg);
     } else {
-        $msg = Horde_Text_Filter::filter($msg, 'html2text');
+        $msg = Horde_Text_Filter::filter($msg, 'html2text', array('charset' => $charset));
     }
 }
 
index 29e9624..3e420fa 100644 (file)
@@ -181,7 +181,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
          * text. */
         if (($_SESSION['imp']['view'] == 'mimp') ||
             (!$inline && Horde_Util::getFormData('convert_text'))) {
-            $data = Horde_Text_Filter::filter($data, 'html2text');
+            $data = Horde_Text_Filter::filter($data, 'html2text', array('charset' => Horde_Nls::getCharset()));
 
             // Filter bad language.
             return array(
index a7bbb01..d465077 100644 (file)
@@ -39,7 +39,7 @@ $name = Horde_Util::getFormData('name', '');
 $type = Horde_Util::getFormData('type', 'plain');
 if (!empty($last_type) && $last_type != $type) {
     $content = ($type == 'plain')
-        ? Horde_Text_Filter::filter($content, 'html2text')
+        ? Horde_Text_Filter::filter($content, 'html2text', array('charset' => Horde_Nls::getCharset()))
         : nl2br(htmlspecialchars(htmlspecialchars($content)));
 }
 $stationery = array('n' => $name, 't' => $type, 'c' => $content);