Edit report at https://bugs.php.net/bug.php?id=53791&edit=1
ID: 53791 Updated by: ras...@php.net Reported by: jinmoku at hotmail dot com Summary: NumberFormat::parse fail with French thousands separator Status: Feedback Type: Bug Package: I18N and L10N related PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: I spent a bit of time looking at this tonight. As far as I can tell there is nothing wrong on the PHP side here. A quick ICU test program that reproduces this bug is here: == [unum.c] ======================== #include <stdio.h> #include "unicode/utypes.h" #include "unicode/unum.h" #include "unicode/uloc.h" #include "unicode/umisc.h" #include "unicode/parseerr.h" void main(int argc, char *argv[]) { UChar tmp[64]; UNumberFormat *cur_def; int32_t parsepos = 0; UErrorCode status=U_ZERO_ERROR; UNumberFormatStyle style= UNUM_DEFAULT; double d; cur_def = unum_open(style, NULL, 0, argv[1], NULL, &status); if(U_FAILURE(status)) printf("Error1: %s\n", u_errorName(status)); u_uastrcpy(tmp, argv[2]); d = unum_parseDouble(cur_def, tmp, u_strlen(tmp), &parsepos, &status); if(U_FAILURE(status)) printf("Error2: %s\n", u_errorName(status)); printf("%f\n",d); } Compile with: gcc -o unum unum.c -ldl -lm -L/usr/lib -licui18n -licuuc -licudata -ldl -lm or check what your flags should be on your platform with: /usr/bin/icu-config --ldflags then run it like this: $ ./unum fr_FR "1234,56" 1234.560000 $ ./unum fr_FR "1 234,56" 1.000000 I get this with ICU 4.4.2 on Ubuntu. Could someone please try this on ICU 4.6 or 4.8? Previous Comments: ------------------------------------------------------------------------ [2011-12-10 04:57:26] playa71 at gmail dot com Running PHP 5.3.8 on Win7 - this problem still happens. Amazing in 2011 a programming language exists that doesn't support entire countries! sigh. ------------------------------------------------------------------------ [2011-09-05 17:03:26] paj...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ or 5.3.8 ------------------------------------------------------------------------ [2011-09-05 16:56:50] jinmoku at hotmail dot com in fact the french group sep is not a "space" but a "no-breaking space" ------------------------------------------------------------------------ [2011-07-13 08:38:46] jinmoku at hotmail dot com Feedback sent ------------------------------------------------------------------------ [2011-01-21 17:08:20] jinmoku at hotmail dot com On VC9 : string(6) "1 234" float(1) float(1234.56) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=53791 -- Edit this bug report at https://bugs.php.net/bug.php?id=53791&edit=1