1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00

Bring localeconv(), money_format(), and nl_langinfo() to standards. Add

E_STRICT notices about them being deprecated in Unicode mode.
This commit is contained in:
Andrei Zmievski
2006-09-22 18:24:12 +00:00
parent 29ccb96d9e
commit cd58faa031
2 changed files with 26 additions and 20 deletions

View File

@@ -472,19 +472,22 @@ PHP_MINIT_FUNCTION(nl_langinfo)
}
/* }}} */
/* {{{ 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 @@ PHP_FUNCTION(setlocale)
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 @@ PHP_FUNCTION(strnatcmp)
}
/* }}} */
/* {{{ 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 @@ PHP_FUNCTION(localeconv)
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 @@ PHP_FUNCTION(str_word_count)
/* }}} */
#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 @@ PHP_FUNCTION(money_format)
}
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

View File

@@ -20,15 +20,6 @@ ext/standard
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 @@ ext/standard
explode()
implode()
levenshtein()
localeconv()
money_format()
nl_langinfo()
nl2br()
ord()
pathinfo()