|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23363 setlocale() not working
Submitted: 2003-04-26 12:39 UTC Modified: 2003-04-26 16:04 UTC
From: bmansion at mamasam dot com Assigned:
Status: Not a bug Package: *Languages/Translation
PHP Version: 4.3.2RC1 OS: Mac OSX 10.2.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bmansion at mamasam dot com
New email:
PHP Version: OS:


 [2003-04-26 12:39 UTC] bmansion at mamasam dot com
Ex : setlocale(LC_CTYPE, 'fr');

This does not work with MacOSX, LC_ALL neither.
Locale can be found in /usr/share/locale/, they are installed by default.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-26 13:27 UTC]
Use 'fr_FR', since there is no:

LC_ALL doesn't work at all on Mac OSX, as far as I can tell (not only in PHP, but in C also).
 [2003-04-26 16:04 UTC] bmansion at mamasam dot com
/usr/share/locale/fr_FR.ISO8859-1 has LC_CTYPE.

Apparently, it is possible to use at least LC_CTYPE, 
ht://dig does it [1]

But this code won't work:

setlocale(LC_CTYPE, 'fr_FR.ISO8859-1');
// or setlocale(LC_CTYPE, 'fr_FR');
$words = $nonwords = '';
for ($i=0; $i < 255; $i++) {
	if (ctype_alnum(chr($i))) {
		$words .= chr($i);
	} else {
		$nonwords .= chr($i);

It behaves like 'C' locale.

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 06:01:26 2019 UTC