By default, most Linux distributions do not support Chinese characters sorted by pinyin. For software development, if the server needs to sort Chinese characters, it may be difficult to achieve this. The solution to this problem is simple. You only need to install a locale-pinyin software package on Linux and configure the corresponding system environment variables, the Linux system can perfectly support Chinese pinyin sorting. For Ubuntu users, if the source of ubuntu-cn is not configured before
By default, most Linux distributions do not support Chinese characters sorted by pinyin. For software development, if the server needs to sort Chinese characters, it may be difficult to achieve this. The solution to this problem is simple. You only need to install a locale-pinyin software package on Linux and configure the corresponding system environment variables, the Linux system can perfectly support Chinese pinyin sorting.
For Ubuntu users, if the source of ubuntu-cn is not configured before, you need to configure the apt source. For example, cn99.com is used:
Deb http://ubuntu.cn99.com/ubuntu-cn/ gutsy main restricted universe multiverse then run
Sudo apt-get upgrade
Sudo apt-get install locale-pinyin and then edit the/etc/environment file to add or modify the file:
LC_COLLATE = "zh_CN.UTF-8" for other Linux users, you can download locale-pinyin and unzip the compilation and installation. The command is as follows:
Tar xzf locale-pinyin.tar.gz
Cd locale-pinyin
./Configure
Make
Make install and edit/etc/profile or ~ /. Profile, just like Ubuntu users
Export LC_COLLATE = "zh_CN.UTF-8" after installation, modification, restart X Window or log out of the user, log on to the system again, the above changes take effect.