Hi, I found the item sorting has surprising change in Debian Buster when using
zh_CN locale; the Chinese characters are now sorted before English letters. I
usually using LANG=zh_CN.UTF-8 to display localized messages in my system;
however this change affected convenience for me of finding items.
The default sorting mode of ls(1) has been affected by this, I don't exactly
known how ls(1) sorting the files, but I guess the source of the issue is from
the GLIBC, because bash(1) is also affected when trying something like
'echo *'.
For example:
root@debian:~/test# export | grep -F -e LANG -e LC_
declare -x LANG="C.UTF-8"
root@debian:~/test# ls -l
total 40
drwxr-xr-x 2 root root 4096 Sep 4 22:24 111
drwxr-xr-x 2 root root 4096 Sep 4 22:24 222
drwxr-xr-x 2 root root 4096 Sep 4 22:24 aaa
drwxr-xr-x 2 root root 4096 Sep 4 22:24 bbb
drwxr-xr-x 2 root root 4096 Sep 4 22:24 ccc
drwxr-xr-x 2 root root 4096 Sep 4 22:24 test
drwxr-xr-x 2 root root 4096 Sep 4 22:24 z.测试
drwxr-xr-x 2 root root 4096 Sep 4 22:24 zzz
drwxr-xr-x 2 root root 4096 Sep 4 22:24 一
drwxr-xr-x 2 root root 4096 Sep 4 22:24 测试
root@debian:~/test# LANG=en_US.UTF-8 ls -l
total 40
drwxr-xr-x 2 root root 4096 Sep 4 22:24 111
drwxr-xr-x 2 root root 4096 Sep 4 22:24 222
drwxr-xr-x 2 root root 4096 Sep 4 22:24 aaa
drwxr-xr-x 2 root root 4096 Sep 4 22:24 bbb
drwxr-xr-x 2 root root 4096 Sep 4 22:24 ccc
drwxr-xr-x 2 root root 4096 Sep 4 22:24 test
drwxr-xr-x 2 root root 4096 Sep 4 22:24 zzz
drwxr-xr-x 2 root root 4096 Sep 4 22:24 z.测试
drwxr-xr-x 2 root root 4096 Sep 4 22:24 一
drwxr-xr-x 2 root root 4096 Sep 4 22:24 测试
root@debian:~/test# LANG=zh_CN.UTF-8 ls -l
总用量 40
drwxr-xr-x 2 root root 4096 9月 4 22:24 111
drwxr-xr-x 2 root root 4096 9月 4 22:24 222
drwxr-xr-x 2 root root 4096 9月 4 22:24 测试
drwxr-xr-x 2 root root 4096 9月 4 22:24 一
drwxr-xr-x 2 root root 4096 9月 4 22:24 aaa
drwxr-xr-x 2 root root 4096 9月 4 22:24 bbb
drwxr-xr-x 2 root root 4096 9月 4 22:24 ccc
drwxr-xr-x 2 root root 4096 9月 4 22:24 test
drwxr-xr-x 2 root root 4096 9月 4 22:24 z.测试
drwxr-xr-x 2 root root 4096 9月 4 22:24 zzz
root@debian:~/test# LANG=zh_TW.UTF-8 ls -l
總計 40
drwxr-xr-x 2 root root 4096 9月 4 22:24 111
drwxr-xr-x 2 root root 4096 9月 4 22:24 222
drwxr-xr-x 2 root root 4096 9月 4 22:24 aaa
drwxr-xr-x 2 root root 4096 9月 4 22:24 bbb
drwxr-xr-x 2 root root 4096 9月 4 22:24 ccc
drwxr-xr-x 2 root root 4096 9月 4 22:24 test
drwxr-xr-x 2 root root 4096 9月 4 22:24 zzz
drwxr-xr-x 2 root root 4096 9月 4 22:24 z.测试
drwxr-xr-x 2 root root 4096 9月 4 22:24 一
drwxr-xr-x 2 root root 4096 9月 4 22:24 测试
root@debian:~/test# bash -c 'echo *'
111 222 aaa bbb ccc test z.测试 zzz 一 测试
root@debian:~/test# LANG=en_US.UTF-8 bash -c 'echo *'
111 222 aaa bbb ccc test zzz z.测试 一 测试
root@debian:~/test# LANG=zh_CN.UTF-8 bash -c 'echo *'
111 222 测试 一 aaa bbb ccc test z.测试 zzz
root@debian:~/test# LANG=zh_TW.UTF-8 bash -c 'echo *'
111 222 aaa bbb ccc test zzz z.测试 一 测试
It seems only zh_CN has this problem, zh_TW was not.
I has tried to workaround this by setting 'LC_*' variables, but none has worked.
I'm really disliked this change, but I still don't want to give up on the zh_CN
locale that provided by C library.