logo       

Internationalized string sorting: msg#00042

php.tcphp

Subject: Internationalized string sorting

Has anyone done this?

Specifically, I have two strings, both UTF-8 encoded, and should have
at least the ISO-3166 country code and possibly the ISO-639 language
code. How do I determine the lexicographical order of these two strings?

From what I can tell strcoll() doesn't work for this purpose as it assumes
a character encoding based on the locale string passed to setlocale().
The multibyte extension (mbstring) doesn't include any string sorting/
ordering functions, either.

-Bob


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise