Bug #61082 [Com]: localeconv() returns space with int_curr_symbol
| From: | leods92 at gmail dot com | Date: | Wed, 15 Feb 2012 09:09:11 +0000 |
| Subject: | Bug #61082 [Com]: localeconv() returns space with int_curr_symbol | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-167532@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61082&edit=1
ID: 61082
Comment by: leods92 at gmail dot com
Reported by: leods92 at gmail dot com
Summary: localeconv() returns space with int_curr_symbol
Status: Not a bug
Type: Bug
Package: I18N and L10N related
Operating System: Ubuntu
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
I don't have other Linux machines nor OS X here installed to test the behavior.
But if it's standard to UNIX systems, shouldn't then this OSes difference be
documented? It may save someone's time on troubleshooting.
Previous Comments:
------------------------------------------------------------------------
[2012-02-15 00:15:00] aharvey@php.net
Thanks for the report. PHP just returns whatever the system's localeconv()
provides, so if there's an unexpected space, that's coming from Ubuntu's locale
database and needs to be reported to them.
------------------------------------------------------------------------
[2012-02-14 14:20:46] leods92 at gmail dot com
Description:
------------
The function localeconv() returns an array and one of its keys is
'int_curr_symbol' what I expected to return the international currency symbol
(e.g. USD (US dollar), BRL (Brazilian real)).
I develop in a Windows environment and deploy to a Ubuntu machine and that's why
I'm not sure if this is a bug of PHP, bad implementation of standards by Windows
or Ubuntu or an undocumented difference.
The returned int_curr_symbol from the Ubuntu machine contains an extra space at
the end but the one from Windows doesn't. Researching online all I found were old
specification documents. Correct me if I am wrong but from what I understood from
some documents adding a space to the int_curr_symbol is deprecated.
Test script:
---------------
<?php
setlocale(LC_MONETARY, 'en_US');
$x = localeconv();
echo $x['int_curr_symbol'];
?>
Expected result:
----------------
$x['int_curr_symbol'] should output 'USD'.
Actual result:
--------------
$x['int_curr_symbol'] should outputs 'USD '.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61082&edit=1