cvs: pear /I18Nv2 I18Nv2.php package.xml

From: Date: Tue, 05 Oct 2004 18:47:49 +0000
Subject: cvs: pear /I18Nv2 I18Nv2.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-24624@lists.php.net to get a copy of this message
mike Tue Oct 5 14:47:49 2004 EDT Modified files: /pear/I18Nv2 I18Nv2.php package.xml Log: * added I18Nv2::recursiveIconv() * I18Nv2::autoConv() may now decode request variables, as iconv's "input_charset" seems pretty useless http://cvs.php.net/diff.php/pear/I18Nv2/I18Nv2.php?r1=1.18&r2=1.19&ty=u Index: pear/I18Nv2/I18Nv2.php diff -u pear/I18Nv2/I18Nv2.php:1.18 pear/I18Nv2/I18Nv2.php:1.19 --- pear/I18Nv2/I18Nv2.php:1.18 Fri Oct 1 12:27:24 2004 +++ pear/I18Nv2/I18Nv2.php Tue Oct 5 14:47:48 2004 @@ -16,7 +16,7 @@ // | Michael Wallner <mike@iworks.at> | // +----------------------------------------------------------------------+ // -// $Id: I18Nv2.php,v 1.18 2004/10/01 16:27:24 mike Exp $ +// $Id: I18Nv2.php,v 1.19 2004/10/05 18:47:48 mike Exp $ /** * I18Nv2 @@ -31,7 +31,7 @@ * I18Nv2 - Internationalization v2 * * @author Michael Wallner <mike@php.net> -* @version $Revision: 1.18 $ +* @version $Revision: 1.19 $ * @access public * @package I18Nv2 */ @@ -215,10 +215,12 @@ * @access public * @return mixed Returns &true; on success or * <classname>PEAR_Error</classname> on failure. - * @param string $ocs desired output character set - * @param string $ics current intput character set + * @param string $ocs desired output character set + * @param string $ics internal character set + * @param bool $decodeRequest whether to decode request variables + * from $ocs to $ics */ - function autoConv($ocs = 'UTF-8', $ics = 'ISO-8859-1') + function autoConv($ocs = 'UTF-8', $ics = 'ISO-8859-1', $decodeRequest = true) { if (!strcasecmp($ocs, $ics)) { return true; @@ -246,7 +248,34 @@ } echo $buffer; + if ($decodeRequest) { + I18Nv2::recursiveIconv($_GET, $ocs, $ics); + I18Nv2::recursiveIconv($_POST, $ocs, $ics); + I18Nv2::recursiveIconv($_REQUEST, $ocs, $ics); + } + return true; + } + + /** + * Recursive Iconv + * + * @static + * @access public + * @return void + * @param array $value + * @param string $ocs + * @param string $ics + */ + function recursiveIconv(&$value, $from, $to) + { + foreach ($value as $key => $val) { + if (is_array($val)) { + I18Nv2::recursiveIconv($value[$key], $from, $to); + } else { + $value[$key] = iconv($from, $to, $val); + } + } } /** http://cvs.php.net/diff.php/pear/I18Nv2/package.xml?r1=1.38&r2=1.39&ty=u Index: pear/I18Nv2/package.xml diff -u pear/I18Nv2/package.xml:1.38 pear/I18Nv2/package.xml:1.39 --- pear/I18Nv2/package.xml:1.38 Mon Oct 4 10:01:23 2004 +++ pear/I18Nv2/package.xml Tue Oct 5 14:47:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<!-- $Revision: 1.38 $ --> +<!-- $Revision: 1.39 $ --> <package version="1.0"> <name>I18Nv2</name> <summary> @@ -32,20 +32,12 @@ </maintainers> <release> - <version>0.8.0</version> + <version>0.8.1</version> <license>PHP</license> <state>alpha</state> - <date>2004-10-04</date> + <date>2004-10-05</date> <notes><![CDATA[ -Bug Fixes: -* strftime() codes for I18Nv2_Locale::date() and I18Nv2_Locale::time() were mixed up -* set inconv's input encoding to the same as output encoding in I18Nv2::autoConv() -* fixed typos in I18Nv2::languageOf() and I18Nv2::countryOf() referring non-existent class -* prevent encoding the output buffer multiple times if I18Nv2::autoConv() is called more than once - -New Features: -+ allow overriding of the currency symbol in I18Nv2_Locale::formatCurrency() (requested by Andreas Schamberger) -+ added a filtering decorator for lists, I18Nv2_DecoratedList_Filter +* I18Nv2::autoConv() may now decode request variables ]]> </notes> @@ -309,6 +301,24 @@ <date>2004-08-18</date> <notes><![CDATA[ * Fixed bug #2152 +]]> + </notes> + </release> + <release> + <version>0.8.0</version> + <license>PHP</license> + <state>alpha</state> + <date>2004-10-04</date> + <notes><![CDATA[ +Bug Fixes: +* strftime() codes for I18Nv2_Locale::date() and I18Nv2_Locale::time() were mixed up +* set inconv's input encoding to the same as output encoding in I18Nv2::autoConv() +* fixed typos in I18Nv2::languageOf() and I18Nv2::countryOf() referring non-existent class +* prevent encoding the output buffer multiple times if I18Nv2::autoConv() is called more than once + +New Features: ++ allow overriding of the currency symbol in I18Nv2_Locale::formatCurrency() (requested by Andreas Schamberger) ++ added a filtering decorator for lists, I18Nv2_DecoratedList_Filter ]]> </notes> </release>

« previous php.pear.cvs (#24624) next »