Support numbers of Chinese and other language systems when sorting in Dolphin

The default sort attribute in Dolphin for Chinese is pinyin (the romanization of chinese characters)

but this makes Chinese numbers not in their right position which is: (from top to bottom: Chinese, pinyin, Arabic numbers)

一、二、三、四、五、六、七、八、九、十
yi er san si wu liu qi ba jiu shi
1 2 3 4 5 6 7 8 9 10

in alphabetical order it will be

八、二、六、九、七、三、四、十、五、一、
ba er liu jiu qi san si shi wu yi
8 2 6 9 7 3 4 10 5 1

This made it frustrating when there is lots of files named in Chinese numbers like 第一章(chapter 1)

I guess Dolphin does the sorting with QCollator from Qt, which in turn uses ICU. So you should change ICU for that.

And part of the problem is that, "一“ (U+4E00 CJK UNIFIED IDEOGRAPH-4E00: 一 – Unicode – Codepoints) in unicode is not classified as a digit (category Nd), albeit having a numeric value of 1. So probably ICU doesn’t see it as a number when sorting.

1 Like

You probably need to change this function to set DIGIT_TAG on all characters that have a numeric value:

But I’m not sure if ICU would accept such a change.