Doc #72591 [NEW]: Wrong description for locale setting in function setlocale
| From: | mr dot vstas at gmail dot com | Date: | Wed, 13 Jul 2016 11:16:03 +0000 |
| Subject: | Doc #72591 [NEW]: Wrong description for locale setting in function setlocale | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13722@lists.php.net to get a copy of this message | ||
From: mr dot vstas at gmail dot com
Operating system: Ubuntu 14.04 LTS
PHP version: 5.5.37
Package: Translation problem
Bug Type: Documentation Problem
Bug description:Wrong description for locale setting in function setlocale
Description:
------------
---
From manual page: http://www.php.net/function.setlocale
Incorrect translate in cyrillic.
So it looks at the Russian:
------------------------------------------
"ÐÑли в каÑеÑÑве locale пеÑедан
NULL или "0",
Ð»Ð¾ÐºÐ°Ð»Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð° не бÑдеÑ, а
бÑдеÑ
возвÑаÑено ÑекÑÑее
знаÑение.
------------------------------------------
But in English.
------------------------------------------
If locale is NULL or the empty string "", the locale names will be set
from the values of environment variables with the same names as the
above categories, or from "LANG".
If locale is "0", the locale setting is not affected, only the current
setting is returned.
------------------------------------------
This means that English is written for a different behavior for locale
setting with "0" or with NULL.
---
Test script:
---------------
// default locale ru_RU.UTF8
// change default locale to another. It's work correct.
var_dump(setlocale(LC_ALL,"ru_RU.CP1251"));
// return current locale. It's work correct and return ru_RU.CP1251
var_dump(setlocale(LC_ALL,"0"));
// the resulting behavior is not consistent
// with the description in the Russian translation of documentation
var_dump(setlocale(LC_ALL,NULL));
--
Edit bug report at https://bugs.php.net/bug.php?id=72591&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72591&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72591&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72591&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72591&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72591&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72591&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72591&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72591&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72591&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72591&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72591&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72591&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72591&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72591&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72591&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72591&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72591&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72591&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72591&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72591&r=mysqlcfg