diff options
Diffstat (limited to 'system/core')
-rw-r--r-- | system/core/CodeIgniter.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 9df042f02..a7118bfc7 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -204,11 +204,12 @@ if ( ! is_php('5.4')) * */ $charset = strtoupper(config_item('charset')); + ini_set('default_charset', $charset); if (extension_loaded('mbstring')) { define('MB_ENABLED', TRUE); - mb_internal_encoding($charset); + ini_set('mbstring.internal_encoding', $charset); // This is required for mb_convert_encoding() to strip invalid characters. // That's utilized by CI_Utf8, but it's also done for consistency with iconv. mb_substitute_character('none'); @@ -223,13 +224,20 @@ if ( ! is_php('5.4')) if (extension_loaded('iconv')) { define('ICONV_ENABLED', TRUE); - iconv_set_encoding('internal_encoding', $charset); + // iconv.internal_encoding is deprecated starting with PHP 5.6 + // and it's usage triggers E_DEPRECATED messages. + @ini_set('iconv.internal_encoding', $charset); } else { define('ICONV_ENABLED', FALSE); } + if (is_php('5.6')) + { + ini_set('php.internal_encoding', $charset); + } + /* * ------------------------------------------------------ * Load compatibility features |