Bug #55290 [Com]: \NumberFormatter::parseCurrency() fails

2013-01-02 Thread fkrautwald at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=55290&edit=1

 ID: 55290
 Comment by: fkrautwald at gmail dot com
 Reported by:franssen dot roland at gmail dot com
 Summary:\NumberFormatter::parseCurrency() fails
 Status: Open
 Type:   Bug
 Package:I18N and L10N related
 Operating System:   Linux
 PHP Version:5.3.6 - 5.3.8
 Block user comment: N
 Private report: N

 New Comment:

I don’t believe it is a bug. The problem is the example code. It errors when 
you 
copy it. There is some invisible invalid character between the space and the 
dollar sign, I believe. Try to replace the space character and the dollar sign 
in 
the `$num` variable, typing it.

You can also check it with this code:

$fmt = new \NumberFormatter('de_DE', \NumberFormatter::CURRENCY);
$num = "1.234.567,89 $";
print "We have ".$fmt->parseCurrency($num, $curr)." in $curr\n";


Previous Comments:

[2012-10-23 12:41:26] mail at michael-weimann dot eu

Doesn't work in PHP 5.3.10

intl version 1.1.0
ICU version 4.8.1.1
ICU Data version 4.8.1


[2012-05-05 09:15:37] franssen dot roland at gmail dot com

Still fails in PHP 5.4RC9...

version 1.1.0
ICU version 4.4.2
ICU Data version4.4.2


[2011-11-09 04:56:08] johnlinton at mailinator dot net

Seeing the same issue except I am using PHP 5.3.8 as a fcgi module under apache 
2.2 on Windows 7.


[2011-08-23 18:09:34] franssen dot roland at gmail dot com

Still fails in 5.3.8...
However it does seems to work when parsing in locale en[_US], e.g. $1 returns 
float(1) ("USD"). Didn't spot any other locales that work (mostly tested 
european locales; netherlands, germany, french)


[2011-07-28 07:04:52] franssen dot roland at gmail dot com

Same code does works on PHP 5.2.17 (Linux)

version 1.0.3
ICU version 3.6




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=55290


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55290&edit=1


Bug #55290 [Com]: \NumberFormatter::parseCurrency() fails

2013-01-02 Thread fkrautwald at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=55290&edit=1

 ID: 55290
 Comment by: fkrautwald at gmail dot com
 Reported by:franssen dot roland at gmail dot com
 Summary:\NumberFormatter::parseCurrency() fails
 Status: Open
 Type:   Bug
 Package:I18N and L10N related
 Operating System:   Linux
 PHP Version:5.3.6 - 5.3.8
 Block user comment: N
 Private report: N

 New Comment:

That is odd that the example code had a hidden character which created an 
error, 
and removing it fixed the example on PHP 5.4.10 on Windows 7.

I am aware that this is filed as a bug under Linux, but what a remarkable 
coincidence.


Previous Comments:

[2013-01-02 10:26:56] franssen dot roland at gmail dot com

Tested the example code once more (copy-paste) on PHP 5.4.10 (ICU version 
4.4.1, ICU Data version 4.4.0.1).

It still fails :') Also re-typing the code didnt help;

parseCurrency($num, $curr) . ' in ' . $curr . PHP_EOL;


[2013-01-02 08:35:24] fkrautwald at gmail dot com

I don’t believe it is a bug. The problem is the example code. It errors when 
you 
copy it. There is some invisible invalid character between the space and the 
dollar sign, I believe. Try to replace the space character and the dollar sign 
in 
the `$num` variable, typing it.

You can also check it with this code:

$fmt = new \NumberFormatter('de_DE', \NumberFormatter::CURRENCY);
$num = "1.234.567,89 $";
print "We have ".$fmt->parseCurrency($num, $curr)." in $curr\n";


[2012-10-23 12:41:26] mail at michael-weimann dot eu

Doesn't work in PHP 5.3.10

intl version 1.1.0
ICU version 4.8.1.1
ICU Data version 4.8.1


[2012-05-05 09:15:37] franssen dot roland at gmail dot com

Still fails in PHP 5.4RC9...

version 1.1.0
ICU version 4.4.2
ICU Data version4.4.2


[2011-11-09 04:56:08] johnlinton at mailinator dot net

Seeing the same issue except I am using PHP 5.3.8 as a fcgi module under apache 
2.2 on Windows 7.




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=55290


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55290&edit=1