Search Postgresql Archives

Re: Default PostgreSQL server encoding - Change to unicode (utf8)

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

 



Hello.
Thank you for your answer.
I used the <raw> and </raw> tags, this is probably the reason
why you couldn't see the messages...
Thank you for the two links.
I read this (in the second one): "On Windows, however, UTF-8 encoding can be
used with any locale." yet I still have some questions...

On Unix (Debian GNU Linux Squeeze):
 
=========================================================================================
  psql_cmd> \l

  ----------+----------+----------+-------------+------------
  Name      | Owner    | Encoding | Collation   | Ctype 
  ----------+----------+----------+-------------+------------
  template1 | postgres | UTF8     | en_us.UTF-8 | en_us.UTF-8 
 
=========================================================================================

On Windows (XP):
 
=========================================================================================
  psql_cmd> \l

 
----------+----------+----------+----------------------------+---------------------------
  Name      | Owner    | Encoding | Collation                  | Ctype 
 
----------+----------+----------+----------------------------+---------------------------
  template1 | postgres | UTF8     | English_United States.1252 |
English_United States.1252
 
=========================================================================================

Question 1
  Focusing on the "Collation" and "Ctype" columns, 
  has "English_United States.1252" something to do with "Windows-1252"
("CP-1252")?
  "CP-1252" is an 8 bits character encoding (so, it can map codes to 2^8
characters at most).
  How compatible is this with an "UTF8" "Encoding"?
  For people testing PostgreSQL under Windows, is there any other more
appropriate "Collation" that could be used to set a database collation?
  There is no "locale -a" command avaiblable under Windows. Is there any
workaround?

Question 2
  Suppose I have a PostgreSQL table which has a VARCHAR column "text".
  Suppose I want to insert the string "Li 李" which contains the Chinese
ideograph 李.
  How can I do this with an "INSERT INTO" command?
  I wish I could do something like:
  INSERT INTO t (text) VALUES ('Li U+674E')
  or 
  INSERT INTO t (text) VALUES ('Li \u674E')
  How can I do this?

Thanks and best regards.
--
Léa

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Default-PostgreSQL-server-encoding-Change-to-unicode-utf8-tp5505985p5518720.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[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