[development] Reverse iconv encoding for sorting of international arrays

Gerhard Killesreiter gerhard at killesreiter.de
Thu Jan 11 21:10:09 UTC 2007


Bèr Kessels wrote:
> Op donderdag 11 januari 2007 20:37, schreef Gabor Hojtsy:
>> Ber, ordering is different by language. Dutch people might have completely
>> different rules for ordering for the same letters then Hungarians do.
> 
> Yea, now that you say so I realize this too. Stupid I did not thignk of it 
> before. 
> 
>> Using mbstring() functions might help, although those only allow for utf8
>> handling, not proper locale handling. If you would like to have a function
>> available for Drupal independently of the utf8 function set used, I don't
>> think it is available already.
> 
> This should not be too hard, since such a function would be similar to 
> drupal_convert_to_utf8 in way of checking for installed libs. 
> 
> However, as you point out, this is actually locale-dependant. Which means 
> that, if I want to make a proper ordering system for tagadelic (or any 
> ordered list in Drupal, in fact) I would have to include its ordering 
> mechanism in locale.module, or at least make it a locale setting. 
> 
> 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


Cheers,
	Gerhard



More information about the development mailing list