Search Postgresql Archives

Re:  Hi, For the&

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Martijn
 
I think I mis-understand the UTF-8 sorting in different collation by culture. I google the utf8 +chinese +sort and find some basic information about the sorting in the UTF8. I think the UTF8 encoding sorting result use the sql statement "order by column" on the solaris maybe correct.
 
The native sort order in UTF8, Chinese character is not sorted by the pronunciation what I confused before. As the windows version of PostgreSQL 8.1.4 running on the win-936 sorting order output the Chinese characters is in pronunciation. It is a obvious difference and can not be ignored.
 
So, if my application program should use the pronunciation order, I should use the "order by convert(column using utf8_to_xxxxx)", then I can get the pronunciation order on the Solaris. But, the windows version output an error: could not convert string to UTF-16: error 1113.
 
The windows version PostgreSQL 8.1.4 is a binary install, windows code page is 936(GBK). The database encoding is UTF-8.
The Solaris x86 10 is PostgreSQL 8.1.4 compiled from source. The locale is LANG=zh_CN.GB18030. The database encoding is UTF-8.
 
How can I avoid the convert error on my windows install?
 

-- Steve Yao

 

 



-----原始邮件-----
发件人:"stevegy"
发送时间:2006-10-08 13:19:32
收件人:"martijn van oosterhout" ,"pgsql-general@postgr"
抄送:(无)
主题:Re: [GENERAL] Hi, For the UTF-8 encoding


Hi Martijn,
 
I had changed my Solaris locale setting to zh_CN.UTF-8. I modified the /etc/default/init LANG=zh_CN.UTF-8 and reboot. initdb a new database used the encoding UTF8, but the sort order is wrong on the Solaris.
 
I dig into the TODO list on the postgreSQL web site. The Multi-Language Support ssection I found some resource like this: http://archives.postgresql.org/pgsql-hackers/2006-09/msg00662.php
 
I guess the encoding of UTF-8 support is not stable right now in PostgreSQL. But, on my windows box, 8.1.4 handle the utf8 sorting good. What can I do now? waiting for some kind of patch?
 
 
 
-- Steve Yao
 
 
 


-----原始邮件-----
发件人:"Martijn van Oosterhout"
发送时间:2006-10-04 17:42:00
收件人:"stevegy"
抄送:pgsql-general@xxxxxxxxxxxxxx
主题:Re: [GENERAL] Hi, ever


On Wed, Oct 04, 2006 at 07:50:12AM +0800, stevegy wrote:



> My testing database is initdb -E UTF8. And  i guess the solaris can



> not handle the UTF-8 sorting with the LC_COLLATE="zh_CN.GB18030". But



> i need to prove this.







A locale can only handle one charset, usually the one given by "locale



charset". So if it handles sorting in GB18030 then by definition it



can't handle UTF-8.







> So i plan to change the locale of my solaris box. I have installed



> the zh_CN.UTF8 on it. I am looking for a way to change the solaris



> locale. If this changing need to re-boot machine that I should do



> this in some not busy time for the live application.







The locale is not a global setting. If you set the LANG or LC_ALL



variable, it will change the locale of any program run with that



environment variable. The default is the "C" locale.







Have a nice day,



-- 



Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/



> From each according to his ability. To each according to his ability to litigate.










美 女 看 了 就 想 要 ( 图 )
绝 对 另 类 ! 和 老 婆 长 假 期 间 的 败 家 记 录 ( 组 图 )







美 女 看 了 就 想 要 ( 图 )
绝 对 另 类 ! 和 老 婆 长 假 期 间 的 败 家 记 录 ( 组 图 )

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux