0010928: iconv use is deprecated
authorMichael Spahn <kontakt@michaelspahn.de>
Mon, 27 Apr 2015 09:51:58 +0000 (11:51 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 2 Jul 2015 13:57:44 +0000 (15:57 +0200)
https://forge.tine20.org/view.php?id=10928

Change-Id: I1c5908f5b507a7378d4b1a4a9746810b83e2fc3e
Reviewed-on: http://gerrit.tine20.com/customers/1884
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/bootstrap.php

index 021d6d9..9260c79 100644 (file)
@@ -20,9 +20,15 @@ error_reporting(E_COMPILE_ERROR | E_CORE_ERROR | E_ERROR | E_PARSE);
 ini_set('display_errors', 1);
 ini_set('log_errors', 1);
 
-// set default internal encoding
-if (extension_loaded('iconv')) {
-    iconv_set_encoding("internal_encoding", "UTF-8");
+// iconv_set_encoding throws a deprecated exception since 5.6.*
+// Zend 1 still uses that, but at least we can effort to fix that.
+if (PHP_VERSION_ID > 50600) {
+    ini_set('default_charset', 'UTF-8');
+} else {
+    // set default internal encoding
+    if (extension_loaded('iconv')) {
+        iconv_set_encoding('internal_encoding', "UTF-8");
+    }
 }
 
 // intialize composers autoloader