Skip to content

Sort order & locale #8

@ropery

Description

@ropery

So sorting by name/title doesn't seem to work in the Chinese locale.

In contrast, the Contacts app sorts names correctly, i.e. by the pinyin of the characters. If LC_COLLATE is respected this should just work... I can't figure out what order Notepad is putting those in right now...

Edit: actually, the sort order Notepad is currently using is the same as when LC_COLLATE is C. For example,

$ printf '%s\n' 中 国|LC_COLLATE=zh_CN sort 
国
中
$ printf '%s\n' 中 国|LC_COLLATE=C sort          
中
国

The former is in pinyin order, while the latter is the same order Notepad is producing.

Edit: To clarify, the above wasn't produced in the shell on the phone, but a separate PC. I have now tried it in the shell launched via adb shell, and to my surprise, not only is there no locale command, but setting LC_COLLATE doesn't do anything; it produces the order as if LC_COLLATE is C or just unset. Don't know if this is relevant... I guess this adb shell is probably restricted in some way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions