Bug #63688 [Opn->Wfx]: setlocale() fails on TS build
Edit report at https://bugs.php.net/bug.php?id=63688&edit=1
ID: 63688
Updated by: ab@php.net
Reported by: ab@php.net
Summary: setlocale() fails on TS build
-Status: Open
+Status: Wont fix
Type: Bug
Package: *General Issues
Operating System: Windows
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
looks like this isn't fixable in PHP
Previous Comments:
------------------------------------------------------------------------
[2013-02-09 19:46:47] charnad at gmail dot com
Bug can be reproduced on all thread safe versions above 5.3.5 (5.3.6 - 5.4.9 for
the moment) in CLI mode.
Bug does not reproduce on all non-thread safe versions.
------------------------------------------------------------------------
[2012-12-04 17:41:56] ab@php.net
Description:
------------
CLI TS build fails to set the locale
The relevant place in the code seems to be this:
http://lxr.php.net/xref/PHP_5_3/main/SAPI.c#82
Extending this code right in place like
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)
setlocale(LC_ALL, "german");
lcnv = localeconv();
lcl = _get_current_locale();
and checking then *lcnv->decimal_point == ',' results in false. As well other values of
the lconv scruct don't correspond to the set locale (german in this case).
_configthreadlocale()is not invoked in the NTS builds and setlocale works correct there.
Test script:
---------------
Those two tests
tests\lang\034.phpt
tests\lang\bug30638.phpt
a simpler test case
<?php
echo setlocale(LC_NUMERIC, 'german') . "\n";
echo (float)'3.14\n';
Expected result:
----------------
German_Germany.1252
3,14
Actual result:
--------------
German_Germany.1252
3.14
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63688&edit=1
Thread (3 messages)