From: Michael M Slusarz Date: Tue, 4 May 2010 18:23:57 +0000 (-0600) Subject: Convert charset back to original charset X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5fc72b0a51acbff247c4abe5c76581c2f593801d;p=horde.git Convert charset back to original charset --- diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php index 382c0ab7b..9bcddf0f0 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php @@ -99,15 +99,16 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base */ public function postProcess($text) { - $text = Horde_String::convertCharset($text, $this->_params['charset'], 'UTF-8'); - if (extension_loaded('dom')) { + $text = Horde_String::convertCharset($text, $this->_params['charset'], 'UTF-8'); + $old_error = libxml_use_internal_errors(true); $doc = DOMDocument::loadHTML('' . $text); if ($old_error) { libxml_use_internal_errors(false); } - $text = $this->_node($doc, $doc); + + $text = Horde_String::convertCharset($this->_node($doc, $doc), 'UTF-8', $this->_params['charset']); } /* Bring down number of empty lines to 2 max, and remove trailing