Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Unicode (foreign language words)

Status
Not open for further replies.

Extension

Programmer
Nov 3, 2004
311
CA
Hi,

I have words in Cyrillic-1251 (Ukrainian-Russian) and I want to sort them A-Z but it's only partially working right now. I guess PHP is converting the unicode characters into single-byte characters ??

Any guidance would be appreciated.
 

I'm using ksort (word in contained in key)
The words are in Windows-1251 (CP1251)

It seems to be supported.

Thanks.
 
I do not know whether ksort() is multibyte aware or not. Since the PHP online manual does not say it it, the function probably is not.

If ksort() is not working for you, my one recommendation is to use uksort() with a multibye-safe or binary-safe comparison function. The online manual states that strcmp() is binary-safe.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top