removes deprecated warning for iconv_set_encoding
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 5 Apr 2016 13:49:37 +0000 (15:49 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 6 Apr 2016 08:34:05 +0000 (10:34 +0200)
.... with php > 5.6

Change-Id: Ibb6cd9bd7319c94f65ee13fdaba0a6aa08a81e60
Reviewed-on: http://gerrit.tine20.com/customers/3005
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/library/Zend/Locale/Format.php

index c57ceab..eb843b0 100644 (file)
@@ -299,7 +299,15 @@ class Zend_Locale_Format
 
         // Get correct signs for this locale
         $symbols = Zend_Locale_Data::getList($options['locale'], 'symbols');
-        @iconv_set_encoding('internal_encoding', 'UTF-8');
+
+        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");
+            }
+        }
 
         // Get format
         $format = $options['number_format'];