From 7efeec5acdc9423880660ec89d2afd98c8fee743 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Tue, 29 Dec 2009 17:08:04 +0000 Subject: [PATCH] - Fixed bug Trac #65: incorrect display of non-ASCII characters. htmlentities must be aware of the charset used ! SVN:trunk[217] --- core/MyHelpers.class.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/MyHelpers.class.inc.php b/core/MyHelpers.class.inc.php index 8ee89a5ff..16e149cd9 100644 --- a/core/MyHelpers.class.inc.php +++ b/core/MyHelpers.class.inc.php @@ -434,9 +434,10 @@ class Str } public static function pure2html($pure, $maxLength = false) { + // Check for HTML entities, but be careful the DB is in UTF-8 return $maxLength - ? htmlentities(substr($pure, 0, $maxLength)) - : htmlentities($pure); + ? htmlentities(substr($pure, 0, $maxLength), ENT_COMPAT, 'UTF-8') + : htmlentities($pure, ENT_COMPAT, 'UTF-8'); } public static function pure2sql($pure, $maxLength = false) {