From f2b9bc82eddff1fc08addf552190cbdd6cceeba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Thu, 26 Jun 2014 10:57:37 +0200 Subject: [PATCH] utf-8 conversion with mb_convert_encoding instead of bugged iconv --- application/core/Utils/Formatter.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/application/core/Utils/Formatter.php b/application/core/Utils/Formatter.php index 4977c0ef..75430032 100644 --- a/application/core/Utils/Formatter.php +++ b/application/core/Utils/Formatter.php @@ -178,15 +178,6 @@ abstract class Formatter { * @return string */ public static function utf8($text) { - if (!$text) { - return $text; - } - $value = @iconv('UTF-8', 'UTF-8//IGNORE', $text); - if (!$value) { - // Prevent bugged iconv() of some systems - $text = preg_replace('/[^[:print:]]/', '', $text); - $value = iconv('UTF-8', 'UTF-8//IGNORE', $text); - } - return $value; + return mb_convert_encoding($text, 'UTF-8'); } }