pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeroen T. Vermeulen <jtv@xs4all.nl>
To: Korumilli, Bala S (GE Healthcare) <Bala.Korumilli@ge.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Problem with character encodings.
Date: Thu, 30 Aug 2007 15:57:11 +0700 (ICT)
Message-ID: <13676.125.24.219.40.1188464231.squirrel@webmail.xs4all.nl> (raw)
In-Reply-To: <BF8B7E5C1F593446B8C0AD412C265ED7014680D5@BANMLVEM04.e2k.ad.ge.com>
References: <BF8B7E5C1F593446B8C0AD412C265ED7014680D5@BANMLVEM04.e2k.ad.ge.com>

On Wed, August 29, 2007 13:59, Korumilli, Bala S (GE Healthcare) wrote:

> 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?

No.  Inserting and extracting characters like this should be no problem,
*if* they are properly encoded.


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

The database doesn't expose its encoding IIRC, only its character set.  So
it's possible that that should be Unicode, not UTF-8.

But how did you specify this special character in your C++ source file? 
Because if you typed it in directly as a non-ASCII character, it's quite
possible that your editor and your compiler disagree on encoding.  Or that
the compiler uses an encoding that does not happen to match the client
encoding.


Jeroen





view thread (5+ messages)  latest in thread

Message-ID: <13676.125.24.219.40.1188464231.squirrel@webmail.xs4all.nl>
Permalink:  ../13676.125.24.219.40.1188464231.squirrel@webmail.xs4all.nl/
Also on:    postgresql.org/message-id/13676.125.24.219.40.1188464231.squirrel@webmail.xs4all.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jtv@xs4all.nl, Bala.Korumilli@ge.com
  Subject: Re: Problem with character encodings.
  In-Reply-To: <13676.125.24.219.40.1188464231.squirrel@webmail.xs4all.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox