Skip site navigation (1) Skip section navigation (2)

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: (view raw or whole thread)
Lists: pgsql-interfaces
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.


pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group