Re: Please help - libpq API

From: "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar(dot)Pyatalo(at)honeywell(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar(dot)Pyatalo(at)honeywell(dot)com>, pgsql-admin(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: Please help - libpq API
Date: 2005-09-12 03:00:23
Message-ID: 77ED2BF75D59D1439F90412CC5B109742434FB01@ie10-sahara.hiso.honeywell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-novice


Hi all,

Thanks for all your patience and help. I really appreciate this group as I
have always found someone or the other replying to my questions. For my
problem, I set the client and server encoding to UNICODE. The problem that
libpq functions does not support wide characters still remains. I am
converting the wide character strings to proper UTF-8 format and passing it
to the libpq functions. But I still feel that libpq functions should support
wide character datatypes also.

Regs,
Pradeep

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Thursday, September 08, 2005 10:17 PM
To: Alvaro Herrera
Cc: Pradeepkumar, Pyatalo (IE10); pgsql-admin(at)postgresql(dot)org;
pgsql-novice(at)postgresql(dot)org
Subject: Re: [ADMIN] Please help - libpq API

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> On Wed, Sep 07, 2005 at 11:40:57PM -0700, Pradeepkumar, Pyatalo (IE10)
wrote:
>> Even if somehow if I convert wchar_t * to char * and provide it to
>> Postgres, how will it differentiate between chinese characters and
>> normal characters ??

> Please note that any string you pass from the client will be
> interpreted using the client_encoding setting. So maybe what you have
> to do is just set client_encoding to the encoding that the strings are
encoded in.

I think his problem is that his data is represented in UCS2 or UCS4 (or some
other fixed-width representation) and we don't support those as
client_encoding values AFAIK. He'll need to do an encoding conversion to
some representation we do support, such as UTF8.

regards, tom lane

Browse pgsql-admin by date

  From Date Subject
Next Message Nirav Parikh 2005-09-12 06:57:16 plperl
Previous Message Greg Sabino Mullane 2005-09-11 14:17:20 Re: Disabling WAL for bulk data loads

Browse pgsql-novice by date

  From Date Subject
Next Message suresh ramasamy 2005-09-12 11:37:37 tutorial
Previous Message Michael Glaesemann 2005-09-11 10:59:12 Re: Weird SQL Problem