Bug #63688 [NEW]: setlocale() fails on TS build
From: ab
Operating system: Windows
PHP version: Irrelevant
Package: *General Issues
Bug Type: Bug
Bug description:setlocale() fails on TS build
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 bug report at https://bugs.php.net/bug.php?id=63688&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63688&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63688&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63688&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63688&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63688&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63688&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63688&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63688&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63688&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63688&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63688&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63688&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63688&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63688&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63688&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63688&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63688&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63688&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63688&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63688&r=mysqlcfg
Thread (3 messages)
- ab@php.net