Bug #63688 [Com]: setlocale() fails on TS build
| From: | charnad at gmail dot com | Date: | Sat, 09 Feb 2013 19:46:47 +0000 |
| Subject: | Bug #63688 [Com]: setlocale() fails on TS build | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-176544@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63688&edit=1
ID: 63688
Comment by: charnad at gmail dot com
Reported by: ab@php.net
Summary: setlocale() fails on TS build
Status: Open
Type: Bug
Package: *General Issues
Operating System: Windows
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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