Problem with character encodings.

From: "Korumilli, Bala S (GE Healthcare)" <Bala(dot)Korumilli(at)ge(dot)com>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: Problem with character encodings.
Date: 2007-08-29 06:59:52
Message-ID: BF8B7E5C1F593446B8C0AD412C265ED7014680D5@BANMLVEM04.e2k.ad.ge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi,

We recently moved to postgres.
We need a special character '°' degree symbol in our database.

Query of interest: INSERT INTO test1 VALUES(3,'sree°kanth','05/05/1983','06:06:06.234',3.2345677787);

If i use PGADMIN to run this query, '°' is properly inserted into database.

But If i write a c++ program using LIBPQ to run this query, I get an error of invalid byte sequence like this..

ERROR: invalid byte sequence for encoding "UTF8".

I also observed the same error comes for all the characters other than ascii(0-127).
Is it a limitation of LibPQ library?

The follwing information may be helpful to you.
DataBase encoding: UTF8.
client_encoding: UTF8
Postgres version: 8.2.3

Can you please tell me what is the reason for this strange behaviour?


Thanks & Regards
Bala Sreekanth.

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2007-08-30 00:19:23 Re: plpgsql: defuault parameters and constant function parameters
Previous Message Brijesh Shrivastav 2007-08-28 18:45:23 Re: Issue with PQdescribePortal to describe a select cursor