<div dir="ltr">Hi all,<br>
<br>
I have 2 linux distro —— ubuntu and centos.<br>
<br>
My problem is that the sort command has different behavior when<br>
sorting Chinese string encoded in utf8 file.<br>
<br>
On Ubuntu, it is OK.  But on CentOS, it WRONG.<br>
<br>
I google this problem and it seems that's because of LC_COLLATE.<br>
<br>
So I change "/etc/sysconfig/i18n" on CentOS and now the 2 have the<br>
same LC_** like this:<br>
<br>
CentOS:<br>
=============================<br>
[root@localhost ~]# locale<br>
LANG=zh_CN.UTF-8<br>
LC_CTYPE=zh_CN.UTF-8<br>
LC_NUMERIC="zh_CN.UTF-8"<br>
LC_TIME="zh_CN.UTF-8"<br>
LC_COLLATE=zh_CN.UTF-8<br>
LC_MONETARY="zh_CN.UTF-8"<br>
LC_MESSAGES="zh_CN.UTF-8"<br>
LC_PAPER="zh_CN.UTF-8"<br>
LC_NAME="zh_CN.UTF-8"<br>
LC_ADDRESS="zh_CN.UTF-8"<br>
LC_TELEPHONE="zh_CN.UTF-8"<br>
LC_MEASUREMENT="zh_CN.UTF-8"<br>
LC_IDENTIFICATION="zh_CN.UTF-<div id=":52" class="ArwC7c ckChnd">8"<br>
LC_ALL=<br>
<br>
Ubuntu<br>
=============================<br>
peter@ubuntu:~$ locale<br>
LANG=zh_CN.UTF-8<br>
LANGUAGE=zh_CN:zh<br>
LC_CTYPE="zh_CN.UTF-8"<br>
LC_NUMERIC="zh_CN.UTF-8"<br>
LC_TIME="zh_CN.UTF-8"<br>
LC_COLLATE="zh_CN.UTF-8"<br>
LC_MONETARY="zh_CN.UTF-8"<br>
LC_MESSAGES="zh_CN.UTF-8"<br>
LC_PAPER="zh_CN.UTF-8"<br>
LC_NAME="zh_CN.UTF-8"<br>
LC_ADDRESS="zh_CN.UTF-8"<br>
LC_TELEPHONE="zh_CN.UTF-8"<br>
LC_MEASUREMENT="zh_CN.UTF-8"<br>
LC_IDENTIFICATION="zh_CN.UTF-8"<br>
LC_ALL=<br>
<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
<br>
But, the result is still incorrect on CentOS!  I almost got crazy!!!<br>
<br>
PS: the background of this problem is that Postgresql's "order by"<br>
command depends on the sort result of the OS.</div>
</div>