php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-26 13:27 UTC] msopacua@php.net
Use 'fr_FR', since there is no:
/usr/share/locale/fr/LC_CTYPE.

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.


[1] http://www.stepwise.com/Articles/Workbench/2002-11-
01.01.html
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 22:01:27 2024 UTC