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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jordi at jcanals dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Mon Dec 30 14:01:28 2024 UTC