andrei Fri Sep 22 18:24:12 2006 UTC Modified files: /php-src unicode-progress.txt /php-src/ext/standard string.c Log: Bring localeconv(), money_format(), and nl_langinfo() to standards. Add E_STRICT notices about them being deprecated in Unicode mode. http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.48&r2=1.49&diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.48 php-src/unicode-progress.txt:1.49 --- php-src/unicode-progress.txt:1.48 Fri Sep 22 17:47:09 2006 +++ php-src/unicode-progress.txt Fri Sep 22 18:24:12 2006 @@ -20,15 +20,6 @@ Figure out if this is something we can use ICU for, internally. Check with Zeev. - localeconv() - Params API, update to use *_rt_* API. - - money_format() - Just IS_UNICODE support with *_rt_* API. - - nl_langinfo() - Params API, otherwise leave alone - parse_str() Params API. How do we deal with encoding of the data? @@ -150,6 +141,9 @@ explode() implode() levenshtein() + localeconv() + money_format() + nl_langinfo() nl2br() ord() pathinfo() http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.589&r2=1.590&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.589 php-src/ext/standard/string.c:1.590 --- php-src/ext/standard/string.c:1.589 Fri Sep 22 17:47:09 2006 +++ php-src/ext/standard/string.c Fri Sep 22 18:24:12 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.589 2006/09/22 17:47:09 andrei Exp $ */ +/* $Id: string.c,v 1.590 2006/09/22 18:24:12 andrei Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -472,19 +472,22 @@ } /* }}} */ -/* {{{ proto string nl_langinfo(int item) +/* {{{ proto string nl_langinfo(int item) U Query language and locale information */ PHP_FUNCTION(nl_langinfo) { - zval **item; + long item; char *value; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &item) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &item) == FAILURE) { + return; } - convert_to_long_ex(item); - value = nl_langinfo(Z_LVAL_PP(item)); + if (UG(unicode)) { + php_error_docref(NULL TSRMLS_DC, E_STRICT, "deprecated in Unicode mode, please use ICU locale functions"); + } + + value = nl_langinfo(item); if (value == NULL) { RETURN_FALSE; } else { @@ -5514,6 +5517,11 @@ efree(args); WRONG_PARAM_COUNT; } + + if (UG(unicode)) { + php_error_docref(NULL TSRMLS_DC, E_STRICT, "deprecated in Unicode mode, please use ICU locale functions"); + } + #ifdef HAVE_SETLOCALE pcategory = args[0]; if (Z_TYPE_PP(pcategory) == IS_LONG) { @@ -6435,7 +6443,7 @@ } /* }}} */ -/* {{{ proto array localeconv(void) +/* {{{ proto array localeconv(void) U Returns numeric formatting information based on the current locale */ PHP_FUNCTION(localeconv) { @@ -6443,8 +6451,12 @@ int len, i; /* We don't need no stinkin' parameters... */ - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) { + return; + } + + if (UG(unicode)) { + php_error_docref(NULL TSRMLS_DC, E_STRICT, "deprecated in Unicode mode, please use ICU locale functions"); } MAKE_STD_ZVAL(grouping); @@ -7045,7 +7057,7 @@ /* }}} */ #if HAVE_STRFMON -/* {{{ proto string money_format(string format , float value) +/* {{{ proto string money_format(string format , float value) U Convert monetary value(s) to string */ PHP_FUNCTION(money_format) { @@ -7065,7 +7077,7 @@ } str[str_len] = 0; - RETURN_STRINGL(erealloc(str, str_len + 1), str_len, 0); + RETURN_RT_STRINGL(erealloc(str, str_len + 1), str_len, 0); } /* }}} */ #endif
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php