php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65769 localeconv() broken in TS builds
Submitted: 2013-09-26 15:09 UTC Modified: 2013-09-27 02:50 UTC
From: christoph at ymail dot com Assigned:
Status: Closed Package: Strings related
PHP Version: 5.5.4 OS: Windows 7 x64
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: christoph at ymail dot com
New email:
PHP Version: OS:

 

 [2013-09-26 15:09 UTC] christoph at ymail dot com
Description:
------------
I try to set the locale for my script on Windows. There is *no* webserver 
involved, we're talking about running vanilla PHP binaries directly on the cmd.

Using the TS builds does not work, localeconv() returns empty data.
Using the NTS builds works fine.

Both PHP versions are 5.5.4, straight from windows.php.net. No changes to the 
php.ini (in fact, there is no php.ini at all). There are no other PHP processes 
running anywhere on my system.

I can see (even if I don't fully understand) problems using setlocale() in multu-
threaded webservers and stuff, but there is no multi-threading involved here.

Test script:
---------------
<?php
setlocale(LC_ALL, 'sve');
print_r(localeconv());


Expected result:
----------------
Array
(
    [decimal_point] => ,
    [thousands_sep] =>  
    [int_curr_symbol] => SEK
    [currency_symbol] => kr
    [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
        )

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

)


Actual result:
--------------
Array
(
    [decimal_point] => .
    [thousands_sep] => 
    [int_curr_symbol] => 
    [currency_symbol] => 
    [mon_decimal_point] => 
    [mon_thousands_sep] => 
    [positive_sign] => 
    [negative_sign] => 
    [int_frac_digits] => 127
    [frac_digits] => 127
    [p_cs_precedes] => 127
    [p_sep_by_space] => 127
    [n_cs_precedes] => 127
    [n_sep_by_space] => 127
    [p_sign_posn] => 127
    [n_sign_posn] => 127
    [grouping] => Array
        (
        )

    [mon_grouping] => Array
        (
        )

)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-26 21:32 UTC] aharvey@php.net
-Package: *General Issues +Package: Strings related
 [2013-09-26 21:32 UTC] aharvey@php.net
This appears to work as expected on Linux in both TS and NTS builds, so I'm 
guessing this is Windows specific.
 [2013-09-27 02:50 UTC] pajoye@php.net
It is not (always, there are many issues) Windows specific.

Locale are not TS, per se.

I'm not sure it is fixable (out of the PHP scope) and I would strongly suggest to 
use INTL instead for any locale related operations, and not only because of these 
bugs.
 [2014-12-05 10:10 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7943f944c2646f71daf5feb9a0d2f84ec368c1c5
Log: Fixed bug #65769 localeconv() broken in TS builds
 [2014-12-05 10:10 UTC] ab@php.net
-Status: Open +Status: Closed
 [2014-12-06 20:49 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7943f944c2646f71daf5feb9a0d2f84ec368c1c5
Log: Fixed bug #65769 localeconv() broken in TS builds
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 14:01:29 2024 UTC