Re: Support unicode in libpq

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Carmen Wai <wai_carmen(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Support unicode in libpq
Date: 2002-12-03 16:03:31
Message-ID: 26681786.1038935011@liza
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Carmen,

--On Dienstag, 3. Dezember 2002 15:06 +0000 Carmen Wai
<wai_carmen(at)hotmail(dot)com> wrote:

> Hello:
>
> I would like to know how libpq library support with the unicode query? As
> I find that it accepts char string only e.g. PGresult *PQexec(PGconn
> *conn, const char *query)
>
> How can I handle if the query contain the unicode which is of wchar type?

>From my experience with psycopg (the python binding)
you get always 8-bit chars. They are encoded depending
on your actual client encoding:

select pg_client_encoding();

I decide on that encoding wether its unicode or not
and if its unicode decode it from utf-8 to unicode.
I think the same could be done in your case.

Regards
Tino

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-12-03 16:03:33 Re: Segmentation fault while COPY in 7.3
Previous Message Bruce Momjian 2002-12-03 16:00:47 Re: 7.4 Wishlist