Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 74BE69FA084 for ; Thu, 30 Aug 2007 18:16:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 96448-06 for ; Thu, 30 Aug 2007 18:16:41 -0300 (ADT) X-Greylist: delayed 00:19:01.160597 by SQLgrey-1.7.5 Received: from mail13.bluewin.ch (mail13.bluewin.ch [195.186.18.62]) by postgresql.org (Postfix) with ESMTP id DB48D9FA039 for ; Thu, 30 Aug 2007 18:16:44 -0300 (ADT) Received: from [192.168.1.74] (83.79.92.189) by mail13.bluewin.ch (Bluewin 7.3.121) id 46C9BDB8002940C4 for pgsql-interfaces@postgresql.org; Thu, 30 Aug 2007 20:57:41 +0000 From: Ivo Rossacher To: pgsql-interfaces@postgresql.org Subject: Re: Problem with character encodings. Date: Thu, 30 Aug 2007 22:57:40 +0200 User-Agent: KMail/1.9.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708302257.41123.rossacher@bluewin.ch> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/27 X-Sequence-Number: 6621 Am Mittwoch, 29. August 2007 08:59 schrieb Korumilli, Bala S (GE Healthcare): If the client_encoding is UTF8 you need to confert the strings in your c++ code to UTF8. The other options to adjust the client_encoding to the encoding the client machine uses and let the server convert from and to UTF8 for you. This would your client program require to anlyze the encoding of the system and send set client_encoding to ''; to the server. See chapter 21 in the manual for more details about the issue. Best regards Ivo > 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?