#34963 [Opn->Bgs]: strcoll ignore "_" under Linux
| From: | derick@php.net | Date: | Sun, 23 Oct 2005 20:55:23 +0000 |
| Subject: | #34963 [Opn->Bgs]: strcoll ignore "_" under Linux | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86945@lists.php.net to get a copy of this message | ||
ID: 34963
Updated by: derick@php.net
Reported By: brausepaule at gmx dot de
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Linux Suse 9.3
PHP Version: 5.0.5
New Comment:
This is not a bug in PHP. PHP uses the Operating System's collation,
which apperently collates in this way. There is nothing we can do about
it now. In PHP 6 with Unicode support this behavior will be fixed, as
ICU's collation algorithm does sort it the correct way.
Previous Comments:
------------------------------------------------------------------------
[2005-10-23 20:59:48] brausepaule at gmx dot de
setlang means setlocale
sorry
------------------------------------------------------------------------
[2005-10-23 20:36:06] derick@php.net
What is this "Setlang" you're talking about?
------------------------------------------------------------------------
[2005-10-23 20:13:08] brausepaule at gmx dot de
Description:
------------
Under Linux 9.3 the function strcoll ignore the _
Under Windows it's work fine.
Reproduce code:
---------------
$ar = array('auto', 'beton', 'ätsch', 'ölig',
'test','file 4','file
6','file 7','1 file 2','2 file 1','3 file
3','_file 5');
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge',
'german');
usort($ar,'strcoll');
while (list ($key, $value) = each ($ar))
echo "$key: $value\n";
Expected result:
----------------
Under Windows (it's correct)
0: _file 5
1: 1 file 2
2: 2 file 1
3: 3 file 3
4: ätsch
5: auto
6: beton
7: file 4
8: file 6
9: file 7
10: ölig
11: test
Actual result:
--------------
Under Linux:
0: 1 file 2
1: 2 file 1
2: 3 file 3
3: ätsch
4: auto
5: beton
6: file 4
7: _file 5
8: file 6
9: file 7
10: ölig
11: test
the setlang works! Without setlang with strcmp it seems like:
0: _file 5
1: 1 file 2
2: 2 file 1
3: 3 file 3
4: auto
5: beton
6: file 4
7: file 6
8: file 7
9: test
10: ätsch
11: ölig
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34963&edit=1