Alphabetize Arabic and Japanese text that is in Unicode?

前端 未结 5 1238
逝去的感伤
逝去的感伤 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:23

    I don't know Ruby, but python has a function, ord() that translates a unicode special character to its unicode code point. For example,

    >>> a = u'ل'
    >>> ord(a)
    0: 1604
    >>> b = u'ع'
    >>> ord(b)
    1: 1593
    

    Look for something like that in Ruby. I assume that the Arabic symbols are listed in unicode in alphabetic order.

提交回复
热议问题