diff options
Diffstat (limited to 'system/core')
-rw-r--r-- | system/core/Utf8.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/system/core/Utf8.php b/system/core/Utf8.php index c789a7ba4..9a92efe68 100644 --- a/system/core/Utf8.php +++ b/system/core/Utf8.php @@ -80,13 +80,13 @@ class CI_Utf8 { { if ($this->is_ascii($str) === FALSE) { - if (ICONV_ENABLED) + if (MB_ENABLED) { - $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str); + $str = mb_convert_encoding($str, 'UTF-8', 'UTF-8'); } - elseif (MB_ENABLED) + elseif (ICONV_ENABLED) { - $str = mb_convert_encoding($str, 'UTF-8', 'UTF-8'); + $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str); } } @@ -123,13 +123,13 @@ class CI_Utf8 { */ public function convert_to_utf8($str, $encoding) { - if (ICONV_ENABLED) + if (MB_ENABLED) { - return @iconv($encoding, 'UTF-8', $str); + return mb_convert_encoding($str, 'UTF-8', $encoding); } - elseif (MB_ENABLED === TRUE) + elseif (ICONV_ENABLED) { - return @mb_convert_encoding($str, 'UTF-8', $encoding); + return @iconv($encoding, 'UTF-8', $str); } return FALSE; |