php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64367 localeconv() should respect ISO C99
Submitted: 2013-03-06 08:41 UTC Modified: 2021-08-27 09:26 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: abdevg at gmail dot com Assigned:
Status: Open Package: Strings related
PHP Version: 5.4.12 OS: Linux
Private report: No CVE-ID: None
 [2013-03-06 08:41 UTC] abdevg at gmail dot com
Description:
------------
Locale data contain important information about currency formatting in fields 
int_p_sep_by_space and int_n_sep_by_space.
C structure lconv contains such fields while PHP localeconv() doesn't return 
them.

I've attached a patch but it probably should also contain something like #IFDEF 
USE_ISOC99 (sorry, I am not a C developer)


Test script:
---------------
set_locale(LC_MONETARY, 'en_US.UTF-8');
$lc = localeconv();
print $lc['int_p_sep_by_space'];

Expected result:
----------------
1

Actual result:
--------------
PHP Notice:  Undefined index: int_p_sep_by_space

Patches

localeconv_isoc99_patch (last revision 2013-03-06 08:42 UTC by abdevg at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-27 09:26 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: Strings related
 [2021-08-27 09:26 UTC] cmb@php.net
This feature request make sense wrt. feature parity with
localeconv(3), although NumberFormatter[1] might be the preferable
alternative for some time.  Anyhow, if anybody is still interested
in this, I suggest to submit a pull request[2].

[1] <https://www.php.net/numberformatter>
[2] <https://github.com/php/php-src/pulls>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 18:01:28 2024 UTC