From: php-france at mattoug dot net
Operating system:
PHP version: 4.3.8
PHP Bug Type: Unknown/Other Function
Bug description: Alphabetical sort with accented characters
Description:
------------
Accented characters are not properly sorted. For example, the right
sorting of "�" is between "a" and "b", for "�" it's between "e" and "f",
and so on...
Reproduce code:
---------------
$table = array("AB" => "Alberta",
"BC" => "Colombie-Britannique",
"MB" => "Manitoba",
"NB" => "Nouveau-Brunswick",
"NL" => "Terre-Neuve-et-Labrador",
"NS" => "Nouvelle-�cosse",
"ON" => "Ontario",
"PE" => "�le-du-Prince-�douard",
"QC" => "Qu�bec",
"SK" => "Saskatchewan",
"NT" => "Territoires du Nord-Ouest",
"NU" => "Nunavut",
"YT" => "Territoire du Yukon");
asort($table);
Expected result:
----------------
array(13) { ["AB"]=> string(7) "Alberta" ["BC"]=> string(20)
"Colombie-Britannique" ["PE"]=> string(21) "�le-du-Prince-�douard"
["MB"]=> string(8) "Manitoba" ["NB"]=> string(17) "Nouveau-Brunswick"
["NS"]=> string(15) "Nouvelle-�cosse" ["NU"]=> string(7) "Nunavut"
["ON"]=> string(7) "Ontario" ["QC"]=> string(6) "Qu�bec" ["SK"]=>
string(12) "Saskatchewan" ["NL"]=> string(23) "Terre-Neuve-et-Labrador"
["YT"]=> string(19) "Territoire du Yukon" ["NT"]=> string(25)
"Territoires du Nord-Ouest"}
Actual result:
--------------
array(13) { ["AB"]=> string(7) "Alberta" ["BC"]=> string(20)
"Colombie-Britannique" ["MB"]=> string(8) "Manitoba" ["NB"]=> string(17)
"Nouveau-Brunswick" ["NS"]=> string(15) "Nouvelle-�cosse" ["NU"]=>
string(7) "Nunavut" ["ON"]=> string(7) "Ontario" ["QC"]=> string(6)
"Qu�bec" ["SK"]=> string(12) "Saskatchewan" ["NL"]=> string(23)
"Terre-Neuve-et-Labrador" ["YT"]=> string(19) "Territoire du Yukon"
["NT"]=> string(25) "Territoires du Nord-Ouest" ["PE"]=> string(21)
"�le-du-Prince-�douard" }
--
Edit bug report at http://bugs.php.net/?id=32219&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32219&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32219&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32219&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32219&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32219&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32219&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32219&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32219&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32219&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32219&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32219&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32219&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32219&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32219&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32219&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32219&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32219&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32219&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32219&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32219&r=mysqlcfg