Alphabetize Arabic and Japanese text that is in Unicode?

前端 未结 5 1229
逝去的感伤
逝去的感伤 2021-01-03 02:23

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.

5条回答
  •  礼貌的吻别
    2021-01-03 03:12

    mylist.sort should work out of the box in Ruby 1.9 (which has built-in unicode support). In Ruby 1.8, where Unicode support isn't built in, I think you'd have to use the character-encodings gem extend the String class with UTF-8 string comparisions. (And then mylist.sort would work.)

提交回复
热议问题