From d71b807b8f6f6b7c9f17fd7deb09db0d2ea2df83 Mon Sep 17 00:00:00 2001
From: Nathan Gray
Date: Tue, 6 Sep 2011 18:21:39 +0000
Subject: [PATCH] Use 'utf-8' (instead of utf8) as the encoding, it seems to
solve any encoding issues
---
etemplate/inc/class.bo_merge.inc.php | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php
index 51de612177..cc895fb609 100644
--- a/etemplate/inc/class.bo_merge.inc.php
+++ b/etemplate/inc/class.bo_merge.inc.php
@@ -63,7 +63,8 @@ abstract class bo_merge
public static $tidy_config = array(
'output-xml' => true, // Entity encoding
'show-body-only' => true,
- 'output-encoding' => 'utf8',
+ 'output-encoding' => 'utf-8',
+ 'input-encoding' => 'utf-8',
'quote-ampersand' => false, // Prevent double encoding
'quote-nbsp' => true, // XSLT can handle spaces easier
'preserve-entities' => true,
@@ -740,10 +741,7 @@ abstract class bo_merge
{
// Clean HTML, if it's being kept
if($replace_tags && extension_loaded('tidy')) {
- $value = tidy_repair_string($value, self::$tidy_config +
- // Need to detect encoding to get special chars right
- array('input-encoding'=>mb_detect_encoding($value))
- );
+ $value = tidy_repair_string($value, self::$tidy_config);
}
// replace
and
with CRLF (remove and CRLF)
$value = str_replace(array("\r","\n",'
','
','
'),array('','','',"\r\n","\r\n"),$value);