11 Jan
2007
11 Jan
'07
10:45 p.m.
Gabor Hojtsy wrote:
On Thu, 11 Jan 2007, Gerhard Killesreiter wrote:
Are there any libraries that do this for PHP already where I can look?
PHP does support sorting by locale since PHP 4.4 and 5, see php.net/sort SORT_LOCALE_STRING
Indeed, PHP supports locale aware sorting. Unfortunately all is only nice in PHP 6 (see http://www.php.net/i18n_loc_set_default for a nice example). The question is if sort() supports utf8 sorting by the surrent system locale properly (it sorts by ASCII code by default). I did not try this before.
Neither did I, but I know that you can set the locale using setlocale just fine. It is unclear to me how i18n_loc_set_default is different from this. Cheers, Gerhard