summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-05-06 23:06:31 +0200
committerAndrey Andreev <narf@devilix.net>2014-05-06 23:06:31 +0200
commit51593f49cda71bdf8400ba6555a9e1598ff21c7c (patch)
treeb911c5df9152cb5407d42d426877b9a4df26972d
parentc580968c38ef9246e6da48ad08be733f38759eca (diff)
Account for PHP 5.6 changes related to charsets
-rw-r--r--system/core/CodeIgniter.php12
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