#38314 [NEW]: setlocale() - LC_NUMERIC does not work

From: Date: Thu, 03 Aug 2006 14:14:39 +0000
Subject: #38314 [NEW]: setlocale() - LC_NUMERIC does not work
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100284@lists.php.net to get a copy of this message
From: akorthaus at web dot de Operating system: Mac OS X (10.4.7) PHP version: 5.2.0RC1 PHP Bug Type: Unknown/Other Function Bug description: setlocale() - LC_NUMERIC does not work Description: ------------ LC_NUMERIC does not work, it only makes localeconv() return the correct decimal_point, nothing else. If I use LC_ALL, localeconv() works better (more data, e.g. mon_*) but thousands_sep is still wrong (empty). I installed PHP 5.2.0 RC1 on a MacBook and run "make test", you can find the results here: http://news.php.net/php.qa/26855 The same happens with PHP 4.4.1, shiped with OS X! Reproduce code: --------------- <?php $ret = setlocale(LC_NUMERIC, "de_DE"); var_dump($ret); $lc = localeconv(); print_r($lc); $ret = setlocale(LC_ALL, "de_DE"); var_dump($ret); $lc = localeconv(); print_r($lc); ?> Actual result: -------------- string(5) "de_DE" Array ( [decimal_point] => , [thousands_sep] => [int_curr_symbol] => [currency_symbol] => [mon_decimal_point] => [mon_thousands_sep] => [positive_sign] => [negative_sign] => [int_frac_digits] => 127 [frac_digits] => 127 [p_cs_precedes] => 127 [p_sep_by_space] => 127 [n_cs_precedes] => 127 [n_sep_by_space] => 127 [p_sign_posn] => 127 [n_sign_posn] => 127 [grouping] => Array ( [0] => 127 ) [mon_grouping] => Array ( [0] => 127 ) ) string(5) "de_DE" Array ( [decimal_point] => , [thousands_sep] => [int_curr_symbol] => EUR [currency_symbol] => Eu [mon_decimal_point] => , [mon_thousands_sep] => . [positive_sign] => [negative_sign] => - [int_frac_digits] => 2 [frac_digits] => 2 [p_cs_precedes] => 1 [p_sep_by_space] => 0 [n_cs_precedes] => 1 [n_sep_by_space] => 0 [p_sign_posn] => 1 [n_sign_posn] => 1 [grouping] => Array ( [0] => 127 ) [mon_grouping] => Array ( [0] => 3 [1] => 3 ) ) -- Edit bug report at http://bugs.php.net/?id=38314&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38314&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38314&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38314&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38314&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38314&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38314&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38314&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38314&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38314&r=support Expected behavior: http://bugs.php.net/fix.php?id=38314&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38314&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38314&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38314&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38314&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38314&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38314&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38314&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38314&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38314&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38314&r=mysqlcfg

« previous php.bugs (#100284) next »