php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #19836 setlocale LC_ALL separator
Submitted: 2002-10-09 14:46 UTC Modified: 2003-01-21 03:37 UTC
From: msopacua@php.net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4CVS-2002-10-09 OS: AIX 4.3.3
Private report: No CVE-ID: None
 [2002-10-09 14:46 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-10 03:04 UTC] mfischer@php.net
The PHP setlocale() function only returns what the System setlocale() function returns.
 [2002-10-10 06:41 UTC] 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 07:40 UTC] 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.

 [2003-01-21 03:37 UTC] philip@php.net
The docs have been updated:
http://cvs.php.net/cvs.php/phpdoc/en/reference/strings/functions/setlocale.xml

Thanks for the report :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC