From 300fc65a461ce37999e3f0df991b24ed1b3c1bd3 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 20 Nov 2008 05:29:34 -0500
Subject: [PATCH] - Better HTML entities conversion in html2text (#1485519)

---
 program/lib/html2text.php |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/program/lib/html2text.php b/program/lib/html2text.php
index 4180cac..938dfec 100644
--- a/program/lib/html2text.php
+++ b/program/lib/html2text.php
@@ -232,7 +232,7 @@
         '--',
         '-',
         '*',
-        '�',
+        '£',
         'EUR',                                  // Euro sign. � ?
         '',                                     // Unknown/unhandled entities
         ' '                                     // Runs of spaces, post-handling
@@ -465,7 +465,10 @@
 
 	// Convert <PRE>
         $this->_convert_pre($text);
-	
+
+	// Replace known html entities
+	$text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
+
         // Run our defined search-and-replace
         $text = preg_replace($this->search, $this->replace, $text);
 

--
Gitblit v1.9.1