#19836 [Opn->Csd]: setlocale LC_ALL separator
| From: | philip@php.net | Date: | Tue, 21 Jan 2003 09:37:58 +0000 |
| Subject: | #19836 [Opn->Csd]: setlocale LC_ALL separator | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969351161@lists.php.net to get a copy of this message | ||
ID: 19836
Updated by: philip@php.net
Reported By: msopacua@php.net
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: AIX 4.3.3
PHP Version: 4CVS-2002-10-09
New Comment:
The docs have been updated:
http://cvs.php.net/cvs.php/phpdoc/en/reference/strings/functions/setlocale.xml
Thanks for the report :)
Previous Comments:
------------------------------------------------------------------------
[2002-10-10 07:40:35] mfischer@php.net
The only sane solution would be to document that the return value of
setlocale() simply depends on the system on which PHP is running.
Reclassifying.
------------------------------------------------------------------------
[2002-10-10 06:41:15] msopacua@php.net
Yep, you're right, Markus.
I was put off, by what FreeBSD returns (and other platforms I guess).
Those platforms consolidate the different values, when the locale is
the same for all.
Despite the difference - AIX is consistent in it's output. It always
returns all values, space separated - when you set them and when you
only query them.
Since the setlocale manual entry already mentions platform specific
issues, I'm not sure this should be "fixed". Even though the manpage
for AIX doesn't specify the output returned:
http://publib.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf2/setlocale.htm
Allthough it makes it harder to write platform independent packages
this way, locale names are already very different, so unless PHP keeps
an internal table of platform differences and defines constants for
different locale names, this function will never be platform
independant and expecting a different output is just another small
issue.
If you agree, change this to "Won't fix" or a doc problem and I'll fix
the testcases affected by this difference.
With doc problem I mean, that the user isn't too much informed right
now, about how different implementations are accross platforms, and
what one should consider.
------------------------------------------------------------------------
[2002-10-10 03:04:48] mfischer@php.net
The PHP setlocale() function only returns what the System setlocale()
function returns.
------------------------------------------------------------------------
[2002-10-09 14:46:49] msopacua@php.net
On AIX setlocale(LC_ALL, locale) returns a space separated list of the
locales in effect, instead of a '/'. A little test program explains:
$ ./o
setlocale LC_ALL, "C" returns <C C C C C C>
setlocale LC_CTYPE, "en_US" returns <en_US>
setlocale LC_ALL, NULL returns <C en_US C C C C>
I've taken a look at ext/standard/string.c but can't figure out
how/where
the string is turned into just one character.
This affects (among other things) ext/ctype/tests/002.phpt
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19836&edit=1