Generally Chinese character sorted by Pinyin that is used in such as Windows system and make Chinese character string finding convenient. But in Anki I found it doesn’t use this to sort character string.I want to know what Anki use in sorting of Chinese character string. And could Anki change over to Pinyin sort?
I note some Chinese character strings used red with Pinying in the above picture.
In Python, the Chinese characters are sorted by its UTF-8 code.
Python 3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:00:30)
[Clang 11.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "三" < "二"
True
>>> "三" < "不"
True
>>> "不" < "二"
True
>>> "三" < "函"
True
>>> "三" < "几"
True
>>> ord("三")
19977
>>> ord("二")
20108
>>> ord("不")
19981
>>> ord("几")
20960
2 Likes
Thank you for your explanation.
(sorting is actually done in Sqlite, but the results are likely the same)