php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31801 localeconv returns wrong LC_NUMERIC settings
Submitted: 2005-02-02 01:44 UTC Modified: 2005-02-02 09:18 UTC
From: jordi at jcanals dot net Assigned:
Status: Not a bug Package: *Languages/Translation
PHP Version: 5.0.3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 - 7 = ?
Subscribe to this entry?

 
 [2005-02-02 01:44 UTC] jordi at jcanals dot net
Description:
------------
The localeconv() provides wrong information in some locales

It produces wrong results for the es_ES and ca_ES locales. As I only provide one example, in both locales I get the same wrong result, and for both, the same correct result below shoud be returned.

This was solved for the locale de_DE as a solution to the bug #30638 (Now for de_DE it returns the correct values).

On windows with the equivalent locales it returns the correct results. Windows equivalents are: Spanish for es_ES and Catalan for ca_ES.

Reproduce code:
---------------
<?php

setlocale(LC_ALL, 'es_ES');
$lc = localeconv();
echo '<pre>'; print_r($lc); echo '</pre>';

?>


Expected result:
----------------
Array
(
    [decimal_point] => ,
    [thousands_sep] => .
    [int_curr_symbol] => EUR 
    [currency_symbol] => EUR
    [mon_decimal_point] => ,
    [mon_thousands_sep] => .
    [positive_sign] => 
    [negative_sign] => -
    [int_frac_digits] => 2
    [frac_digits] => 2
    [p_cs_precedes] => 0
    [p_sep_by_space] => 1
    [n_cs_precedes] => 0
    [n_sep_by_space] => 1
    [p_sign_posn] => 1
    [n_sign_posn] => 1
    [grouping] => Array
        (
            [0] => 3
            [1] => 3
        )

    [mon_grouping] => Array
        (
            [0] => 3
            [1] => 3
        )

)

Note: This is the same result that provides other european languages like de_DE

Actual result:
--------------
Array
(
    [decimal_point] => ,
    [thousands_sep] => 
    [int_curr_symbol] => EUR 
    [currency_symbol] => EUR
    [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] => 1
    [n_cs_precedes] => 1
    [n_sep_by_space] => 1
    [p_sign_posn] => 1
    [n_sign_posn] => 1
    [grouping] => Array
        (
        )

    [mon_grouping] => Array
        (
            [0] => 3
            [1] => 3
        )

)

Note: Both locales es_ES and ca_ES provide the same wrong result.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-02 09:18 UTC] derick@php.net
Complain to the glibc maintainers. PHP is behaving correctly as it uses the data that glibc provides. See the file tequila:/usr/share/i18n/locales/es_ES (search for LC_NUMERIC twice).

Not a bug in PHP.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC