From: Michael M Slusarz Date: Mon, 30 Nov 2009 18:10:33 +0000 (-0700) Subject: Fix charset when converting with html2text X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=287fc26edbbeb296fdeef3897ba6c38ac46c0aef;p=horde.git Fix charset when converting with html2text --- diff --git a/imp/ajax.php b/imp/ajax.php index f4eff0ced..d16941407 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -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': diff --git a/imp/compose.php b/imp/compose.php index a8c11a6c0..61bfba6d8 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -674,7 +674,7 @@ if (!is_null($oldrtemode) && ($oldrtemode != $rtemode)) { array('

 

', '

' . $imp_compose->text2html($sig) . '

'), $msg); } else { - $msg = Horde_Text_Filter::filter($msg, 'html2text'); + $msg = Horde_Text_Filter::filter($msg, 'html2text', array('charset' => $charset)); } } diff --git a/imp/lib/Mime/Viewer/Html.php b/imp/lib/Mime/Viewer/Html.php index 29e9624cc..3e420fa71 100644 --- a/imp/lib/Mime/Viewer/Html.php +++ b/imp/lib/Mime/Viewer/Html.php @@ -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( diff --git a/imp/stationery.php b/imp/stationery.php index a7bbb01bd..d465077da 100644 --- a/imp/stationery.php +++ b/imp/stationery.php @@ -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);