diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-01-08 03:55:10 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-01-08 03:55:10 +0100 |
commit | 92849d9cc553693a3eda5efb6a648187f6ce6064 (patch) | |
tree | 0db3a78bad3fc342742f258e6bdf2d9c15b516bd /system/core/Utf8.php | |
parent | d350d13446faf41d6c0301d34760ba475efd7f49 (diff) | |
parent | 83a2581a5e7c1ae855cb3d6605fec8b3fdb3f1bf (diff) |
Merge remote-tracking branch 'upstream/develop' into develop-db-oci8
Diffstat (limited to 'system/core/Utf8.php')
-rw-r--r-- | system/core/Utf8.php | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/system/core/Utf8.php b/system/core/Utf8.php index 40a7ac4c0..0e180d36f 100644 --- a/system/core/Utf8.php +++ b/system/core/Utf8.php @@ -1,13 +1,13 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * * NOTICE OF LICENSE - * + * * Licensed under the Open Software License version 3.0 - * + * * This source file is subject to the Open Software License (OSL 3.0) that is * bundled with this package in the files license.txt / license.rst. It is * also available through the world wide web at this URL: @@ -47,20 +47,19 @@ class CI_Utf8 { */ public function __construct() { - log_message('debug', "Utf8 Class Initialized"); + log_message('debug', 'Utf8 Class Initialized'); global $CFG; if ( @preg_match('/./u', 'é') === 1 // PCRE must support UTF-8 && function_exists('iconv') // iconv must be installed - && ini_get('mbstring.func_overload') !== 1 // Multibyte string function overloading cannot be enabled - && $CFG->item('charset') == 'UTF-8' // Application charset must be UTF-8 + && @ini_get('mbstring.func_overload') != 1 // Multibyte string function overloading cannot be enabled + && $CFG->item('charset') === 'UTF-8' // Application charset must be UTF-8 ) { - log_message('debug', "UTF-8 Support Enabled"); - define('UTF8_ENABLED', TRUE); + log_message('debug', 'UTF-8 Support Enabled'); // set internal encoding for multibyte string functions if necessary // and set a flag so we don't have to repeatedly use extension_loaded() @@ -77,8 +76,8 @@ class CI_Utf8 { } else { - log_message('debug', "UTF-8 Support Disabled"); define('UTF8_ENABLED', FALSE); + log_message('debug', 'UTF-8 Support Disabled'); } } @@ -134,18 +133,14 @@ class CI_Utf8 { { if (function_exists('iconv')) { - $str = @iconv($encoding, 'UTF-8', $str); + return @iconv($encoding, 'UTF-8', $str); } elseif (function_exists('mb_convert_encoding')) { - $str = @mb_convert_encoding($str, 'UTF-8', $encoding); - } - else - { - return FALSE; + return @mb_convert_encoding($str, 'UTF-8', $encoding); } - return $str; + return FALSE; } // -------------------------------------------------------------------- @@ -163,10 +158,7 @@ class CI_Utf8 { return (preg_match('/[^\x00-\x7F]/S', $str) === 0); } - // -------------------------------------------------------------------- - } -// End Utf8 Class /* End of file Utf8.php */ -/* Location: ./system/core/Utf8.php */
\ No newline at end of file +/* Location: ./system/core/Utf8.php */ |