mirror of
https://github.com/php/php-src.git
synced 2026-03-26 17:22:15 +01:00
Merge branch 'PHP-5.6'
* PHP-5.6: updated NEWS Fixed bug #65769 localeconv() broken in TS builds
This commit is contained in:
@@ -197,8 +197,18 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out)
|
||||
tsrm_mutex_lock( locale_mutex );
|
||||
# endif
|
||||
|
||||
#if defined(PHP_WIN32) && defined(ZTS)
|
||||
{
|
||||
/* Even with the enabled per thread locale, localeconv
|
||||
won't check any locale change in the master thread. */
|
||||
_locale_t cur = _get_current_locale();
|
||||
|
||||
res = cur->locinfo->lconv;
|
||||
}
|
||||
#else
|
||||
/* localeconv doesn't return an error condition */
|
||||
res = localeconv();
|
||||
#endif
|
||||
|
||||
*out = *res;
|
||||
|
||||
|
||||
80
ext/standard/tests/strings/bug65769.phpt
Normal file
80
ext/standard/tests/strings/bug65769.phpt
Normal file
@@ -0,0 +1,80 @@
|
||||
--TEST--
|
||||
Bug #65769 localeconv() broken in TS builds
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') {
|
||||
die('skip Windows only');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$locales = array('sve', 'french', 'us', 'ru', 'czech', 'serbian');
|
||||
|
||||
foreach ($locales as $locale) {
|
||||
$locale = setlocale(LC_ALL, $locale);
|
||||
$lconv = localeconv();
|
||||
var_dump(
|
||||
$locale,
|
||||
$lconv['decimal_point'],
|
||||
$lconv['thousands_sep'],
|
||||
$lconv['int_curr_symbol'],
|
||||
$lconv['currency_symbol'],
|
||||
$lconv['mon_decimal_point'],
|
||||
$lconv['mon_thousands_sep']
|
||||
);
|
||||
echo '++++++++++++++++++++++', "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
+++DONE+++
|
||||
--EXPECTF--
|
||||
string(19) "Swedish_Sweden.1252"
|
||||
string(1) ","
|
||||
string(1) " "
|
||||
string(3) "SEK"
|
||||
string(2) "kr"
|
||||
string(1) ","
|
||||
string(1) "."
|
||||
++++++++++++++++++++++
|
||||
string(18) "French_France.1252"
|
||||
string(1) ","
|
||||
string(1) " "
|
||||
string(3) "EUR"
|
||||
string(1) "€"
|
||||
string(1) ","
|
||||
string(1) " "
|
||||
++++++++++++++++++++++
|
||||
string(26) "English_United States.1252"
|
||||
string(1) "."
|
||||
string(1) ","
|
||||
string(3) "USD"
|
||||
string(1) "$"
|
||||
string(1) "."
|
||||
string(1) ","
|
||||
++++++++++++++++++++++
|
||||
string(2) "ru"
|
||||
string(1) ","
|
||||
string(1) " "
|
||||
string(3) "RUB"
|
||||
string(1) "?"
|
||||
string(1) ","
|
||||
string(1) " "
|
||||
++++++++++++++++++++++
|
||||
string(25) "Czech_Czech Republic.1250"
|
||||
string(1) ","
|
||||
string(1) " "
|
||||
string(3) "CZK"
|
||||
string(2) "Kè"
|
||||
string(1) ","
|
||||
string(1) " "
|
||||
++++++++++++++++++++++
|
||||
string(19) "Serbian_Serbia.1250"
|
||||
string(1) ","
|
||||
string(1) "."
|
||||
string(3) "RSD"
|
||||
string(4) "din."
|
||||
string(1) ","
|
||||
string(1) "."
|
||||
++++++++++++++++++++++
|
||||
+++DONE+++
|
||||
Reference in New Issue
Block a user