ZF-7278: Zend_Locale_Format::toNumber does not restore iconv internal encoding setting when finished

Description

Zend_Locale_Format::toNumber sets the iconv internal encoding setting but does not return it back to its original setting when complete.

Patch:


--- Format.php  (revision 16719)
+++ Format.php  (working copy)
@@ -334,6 +334,7 @@

         // Get correct signs for this locale
         $symbols = Zend_Locale_Data::getList($options['locale'], 'symbols');
+        $oldEncoding = iconv_get_encoding('internal_encoding');
         iconv_set_encoding('internal_encoding', 'UTF-8');

         // Get format
@@ -494,6 +495,7 @@
             }
         }

+        iconv_set_encoding('internal_encoding', $oldEncoding);
         return (string) $format;
     }

Comments

Fixed with r17783