Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 111A29FB2C2 for ; Thu, 30 Aug 2007 18:43:05 -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 01090-09 for ; Thu, 30 Aug 2007 18:42:55 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.235]) by postgresql.org (Postfix) with ESMTP id E01E99FB273 for ; Thu, 30 Aug 2007 18:42:57 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id l8so451873nzf for ; Thu, 30 Aug 2007 14:42:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=i276dUuvhtMLFV39Kac71NDuUNUiVflolrTIQcXEbwjuTUQj1ex17drABQtRqmzaoG+W7RBRFJY9P559mmzcVEt4+KeS9UcZCJUEOjmu8l869j80mv0rocyCihi+Hc2w+MYsPZQcHFqF6dtUWxp/Nc1Jb/9lTSxxqGsvpfMqlAc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=OVHbOd9w5QmYlRr4OYqynq29HSonOemGpheF6ROUR6PU82ACNywKOKa5MXnS0LaG1uEiMkjrz4+IQar7vqTIX+Gy99AuPC1eFi+mkIqQkBqepBBEQq/3MFtajjnWJhVsAJJ7VD3kGyXIno9PHvSmZ8vRjRmT8X6A5BVJhyQ2g0g= Received: by 10.115.108.1 with SMTP id k1mr215884wam.1188510175335; Thu, 30 Aug 2007 14:42:55 -0700 (PDT) Received: by 10.114.134.18 with HTTP; Thu, 30 Aug 2007 14:42:55 -0700 (PDT) Message-ID: Date: Thu, 30 Aug 2007 18:42:55 -0300 From: "Hilton Perantunes" To: pgsql-interfaces@postgresql.org Subject: Re: Problem with character encodings. In-Reply-To: <200708302257.41123.rossacher@bluewin.ch> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6727_6535460.1188510175293" References: <200708302257.41123.rossacher@bluewin.ch> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200708/28 X-Sequence-Number: 6622 ------=_Part_6727_6535460.1188510175293 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I also had similar problems with encoding. I'm using libpqxx, and as Ivo stated, I need do this to get my queries working properly: work T(C, "my_transaction"); T.exec("SET client_encoding =3D UTF8"); result R(T.exec("SELECT * FROM my_table_with_portuguese_strings")); -- On 8/30/07, Ivo Rossacher wrote: > > 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 clien= t > 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? > > ---------------------------(end of broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate > --=20 Hilton William Ganzo Perantunes Sistemas de Informa=E7=E3o - Universidade Federal de Santa Catarina -- Dinheiro n=E3o traz felicidade, mas d=E1 uma sensa=E7=E3o t=E3o parecida...= -_- ------=_Part_6727_6535460.1188510175293 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I also had similar problems with encoding. I'm using libpqxx, and as Iv= o stated, I need do this to get my queries working properly:

 &= nbsp;  work T(C, "my_transaction");
    T.= exec("SET client_encoding =3D UTF8");
    result R(T.exec("SELECT * FROM my_table_with_po= rtuguese_strings"));

--


On 8/30/07, Ivo Rossacher < rossacher@bluewin.ch> wrote:
Am Mittwoch, 29. August 2007 08:59 schrieb Korumil= li, 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 se= nd set
client_encoding to '<found encoding>';  t= o the server.
See chapter 21 in the manual for more details about the is= sue.

Best regards
Ivo

> But If i write a c++ program using LIBP= Q to run this query, I get an error
> of invalid byte sequence like t= his..
>
> ERROR:  invalid byte sequence for encoding = "UTF8".
>
> I also observed the same error comes for all the character= s other than
> ascii(0-127). Is it a limitation of LibPQ library?
= >
> The follwing information may be helpful to you.
> DataBa= se encoding: UTF8.
> client_encoding: UTF8
> Postgres version: 8.2.3
>
&= gt; Can you please tell me what is the reason for this strange behaviour?
---------------------------(end of broadcast)------------------------= ---
TIP 7: You can help support the PostgreSQL project by donating at
            &= nbsp;   h= ttp://www.postgresql.org/about/donate



--
Hilton William Ganzo Perantunes
Sistemas de Informa=E7=E3o - = Universidade Federal de Santa Catarina
--
Dinheiro n=E3o traz felicid= ade, mas d=E1 uma sensa=E7=E3o t=E3o parecida...  -_- ------=_Part_6727_6535460.1188510175293--