Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alphabetize Arabic and Japanese text that is in Unicode?

Does anyone have any code for alphabetizing Arabic and Japanese text that is in Unicode? If the code was in ruby that would be great.

like image 929
James Testa Avatar asked Oct 15 '22 08:10

James Testa


1 Answers

Unicode code points are not listed in alphabetic order (Z < a, for example), but they try to be approximately in that order anyway. There is a canonical unicode order, defined by the Unicode Collation Algorithm and they are also language-specific ordering (french order is not exacly the same as german or czech order, even with the same alphabet), which can be specified in locale information. I think the ICU library contains the language specific algorithms you are looking for.

like image 197
Frédéric Grosshans Avatar answered Oct 20 '22 01:10

Frédéric Grosshans