![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Here is a test (run in pgadmin III): 1. createdb db1 -E Unicode Probably your locale does not support Unicode. You need to pick an encoding that matches your locale or vice versa. |
|
BTW, the locale for traditional chinese in postgresql.conf is set to "traditional-chinese" literally. Shouldn't it be zh_TW? That depends on what locale names the Windows operating system understands. |
#2
| |||
| |||
|
|
Is there any way to check? |
|
I have other programs reading and writing Unicode on this computer without problems. |
|
Are you using the locale routines in mingw? |
#3
| |||
| |||
|
|
On a POSIX system, you can do $ LC_ALL=<some_locale> locale charmap and verify manually that the printed charmap (= character set encoding) matches what you use in PostgreSQL. I don't know whether an equivalent interface exists on Windows. |
|
Reading and writing Unicode is not a problem. But if you run the string comparison operators, PostgreSQL passes the Unicode strings from your database to the operating system's collation routines, which will compare them thinking they are Big5 (or whatever) strings, which will result in the random behavior you observed. You need to set an appropriate locale so that the operating system also thinks they are in Unicode. |
#4
| |||
| |||
|
|
You mean the OS fails to convert unicode strings to Big5 or the OS assumes the bytes are already in Big5? |
|
It is the locale used for initdb or the default system locale set in Windows that is used by the collation routines that you mentioned above? |
![]() |
| Thread Tools | |
| Display Modes | |
| |