Thread: Support for unicode

Support for unicode

From
"Carmen Wai"
Date:
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


Re: Support for unicode

From
Björn Metzdorf
Date:
> 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



Re: Support for unicode

From
"Carmen Wai"
Date:
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