Support for unicode

Started by Carmen Waiabout 23 years ago3 messagesgeneral
Jump to latest
#1Carmen Wai
wai_carmen@hotmail.com

Hello:

Do any one know how to input unicode data into the postgreSQL database
through the PostgreSQL client API? Are there any special API which support
the wide characters??

Carmen

_________________________________________________________________
Help STOP SPAM: Try the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

#2Bjoern Metzdorf
bm@turtle-entertainment.de
In reply to: Carmen Wai (#1)
Re: Support for unicode

Do any one know how to input unicode data into the postgreSQL database
through the PostgreSQL client API? Are there any special API which support
the wide characters??

Have a look at http://www.postgresql.org/idocs/index.php?multibyte.html

What you can do is transform your characters properly to UTF-8 and then
insert them as normal having server and client encoding set to UNICODE.

What you can also do: Don't transform them to UTF-8, but set your
client_encoding to desired value (see the link above) and use the automatic
encoding translation between server and client. They will be automagically
translated to UNICODE (UTF-8).

Regards,
Bjoern

#3Carmen Wai
wai_carmen@hotmail.com
In reply to: Bjoern Metzdorf (#2)
Re: Support for unicode

Hello:

Is that mean just treating the unicode characters as multibyte? How about I
insert the unicode data using libpq C library? Do I just insert the unicode
characters normally as character (char * query)??

PGresult *PQexec(PGconn *conn, const char *query);

Thanks for you help!
Carmen

Have a look at http://www.postgresql.org/idocs/index.php?multibyte.html

What you can do is transform your characters properly to UTF-8 and then
insert them as normal having server and client encoding set to UNICODE.

What you can also do: Don't transform them to UTF-8, but set your
client_encoding to desired value (see the link above) and use the automatic
encoding translation between server and client. They will be automagically
translated to UNICODE (UTF-8).

Regards,
Bjoern

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail