ID: 36718 Updated by: [EMAIL PROTECTED] Reported By: mpmp at zoznam dot sk -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Linux PHP Version: 5.1.2 New Comment:
I received the script and I checked it. There is no bug in PHP, and you can "fix" the issue by: 1. converting your script's encoding to iso-8859-2 (as that is the default encoding on atleast my linux), and not the windows-1250 you use now. 2. Generate locale information with the correct encoding. On my Debian system I do that with: a. Edit /etc/locale.gen and add a line that says: sk_SK CP1250 b. Run "locale-gen" (as root) c. Then change your script to use "sk_SK" instead of "slovak". I did solution two and I now get the correct result: [0] => ábel [1] => äj [2] => čaj [3] => éger [4] => íver [5] => ľad [6] => Ľadový [7] => ňano [8] => ôler [9] => la [10] => ťahaj [11] => iť Previous Comments: ------------------------------------------------------------------------ [2006-03-13 16:09:47] mpmp at zoznam dot sk sent to your email address. ------------------------------------------------------------------------ [2006-03-13 15:25:14] [EMAIL PROTECTED] Please send me the example script in a tar.gz archive and I'll have a look. ------------------------------------------------------------------------ [2006-03-13 15:20:13] mpmp at zoznam dot sk Description: ------------ I am using setlocale(LC_ALL, 'slovak'); Accented characters are not properly sorted on Linux. On windows this code runs well. Locales are installed, and other locales related functions run well. Reproduce code: --------------- $pole = array ( 'čaj', 'ľad', 'ťahaj', 'ábel', 'la', 'íver', 'iť', 'éger', 'ôler', 'ňano', 'äj', 'Ľadový'); setlocale (LC_ALL, "slovak"); sort ($pole, SORT_LOCALE_STRING); Expected result: ---------------- Array ( [0] => ábel [1] => äj [2] => čaj [3] => éger [4] => íver [5] => ľad [6] => Ľadový [7] => ňano [8] => ôler [9] => la [10] => ťahaj [11] => iť ) Actual result: -------------- Array ( [0] => ábel [1] => ťahaj [2] => äj [3] => čaj [4] => éger [5] => iť [6] => íver [7] => la [8] => ňano [9] => ôler [10] => Ľadový [11] => ľad ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36718&edit=1