Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id B4542633D6D for ; Thu, 3 Dec 2009 03:00:39 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 80533-02 for ; Thu, 3 Dec 2009 07:00:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mail.postgresql.org (Postfix) with ESMTP id 98DE66336D3 for ; Thu, 3 Dec 2009 03:00:19 -0400 (AST) Received: by bwz5 with SMTP id 5so828060bwz.3 for ; Wed, 02 Dec 2009 23:00:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=GaiMy3IdJUUqFrb5O5LbVvEg9UHrtc5b7pmk/HpnspI=; b=Af48M+dqdQBqNbwA1s9vpQ+s2gG+Y+wzZwVqCgQRbDQr7MESLI/NIf5hTMpNcT4u/y DUNUvTz36BpJG4D5068jHs10G17cPZBeu8OYpecH5lNjqUPMfaRvQXjj5ipdtEvQ/gTR 8MiCVxsuAzaJB4SKib+t/EPHZ8JA0xDQ3fSOQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=BBCzG1OtWBGBBiyD7DMoCiZMOQa+Yv1JMZyNN4zivRvwsQmP1bJ42jN3xNBZGhkEVf KYwUhxcLb3lpk1At7dkCTuyZ/7Ewpuv9Dxx5/R4llTFFKbWkcLsagamusnVWmbRUz6d5 /ieTvoXHYAgQGGFiA+fXY/QOljuc7+ximQAtI= MIME-Version: 1.0 Received: by 10.204.154.135 with SMTP id o7mr1094307bkw.201.1259823616880; Wed, 02 Dec 2009 23:00:16 -0800 (PST) Date: Thu, 3 Dec 2009 02:00:16 -0500 Message-ID: <64de42ef0912022300kb4f989fgf34e98bf5d2a838f@mail.gmail.com> Subject: Problem with utf8 encoding From: =?ISO-8859-1?Q?Jorge_Miranda_Casta=F1eda?= To: pgsql-php@postgresql.org Content-Type: multipart/alternative; boundary=0015175df19629f2540479cd8b64 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200912/1 X-Sequence-Number: 4096 --0015175df19629f2540479cd8b64 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello everyone! I'm working in a project using postgres, propel, and php. My development environment is: SO: Windows vista Business SP2 Postgres: Postgres v8.4 Propel: Propel generator/runtime v1.4 PHP: PHP v5.3 Currently I'm struggling with a problem caused by the encoding. Everytime I try to insert a row into the table CURRENCY, which has ID, DESC, and SYMBOL as its columns, I get the following error: Unable to execute INSERT statement. [wrapped: SQLSTATE[22021]: Character no= t in repertoire: 7 ERROR: invalid byte sequence for encoding "UTF8": 0x80 HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".] I've created the database using this sentence: *CREATE DATABASE sbs* * WITH OWNER =3D sbsadmin* * ENCODING =3D 'UTF8'* * LC_COLLATE =3D 'Spanish_Peru.1252'* * LC_CTYPE =3D 'Spanish_Peru.1252'* * CONNECTION LIMIT =3D -1;* When I run the following commands in psql I get this: *sbs=3D#SHOW SERVER_ENCODING;* *server_encoding* *---------------* *UTF8* *(1 fila)* *sbs=3D#SHOW CLIENT_ENCODING;* *client_encoding* *---------------* *UTF8* *(1 fila)* The generated file by propel that manages the database connection sets the charset to utf8 too. The insertion fails only everytime I try to insert the currency symbols such as =E2=82=AC, =C2=A5, =C2=A3, =E2=82=B1, etc. I have = no problem with symbols such S/., $, p., Q, L or any other non-special symbol. The curious thing is that when I run the sentence INSERT INTO CURRENCY VALUES(3,'EURO','=E2=82= =AC'); using the query tool of pgAdminIII, I got no error and the query was sucessfully executed. However running the same sentence in psql, I got the row inserted but with ? instead of =E2=82=AC as the currency symbol. I think the utf8 is the apropiate charset to represent these symbols but I have no idea why I'm getting this problem. I've spent the whole day struggling with this problem and I can't figure it out yet. I have tried many things, none of them worked. So this is why I'm here asking for your help, as my last resource. Any guidance that could put me in the right direction to address this problem will be really appreciated! Thanks in advance and I'm sorry If I went on a bit long... --=20 Jorge Miranda Casta=C3=B1eda. Simbiosys Software S.A.C. www.simbiosysonline.com --0015175df19629f2540479cd8b64 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello everyone!

I'm working in a project = using postgres, propel, and php.

My development en= vironment is:
SO: Windows vista Business SP2
Postgres: = Postgres v8.4
Propel: Propel generator/runtime v1.4
PHP: PHP v5.3

Currently I'm struggling with a problem caused by the = encoding. Everytime I try to insert a row into the table CURRENCY, which ha= s ID, DESC, and SYMBOL as its columns, I get the following error:
Unable to execute INSERT statement. [wrapped: SQLSTATE[22021]: Charact= er not in repertoire: 7 ERROR: invalid byte sequence for encoding "UTF= 8": 0x80 HINT: This error can also happen if the byte sequence does no= t match the encoding expected by the server, which is controlled by "c= lient_encoding".]

I've created the database using this sentence:
CREATE DATABASE sbs
=C2=A0=C2=A0WITH OWNER =3D sb= sadmin
=C2=A0=C2=A0 =C2=A0 =C2=A0 ENCODING =3D 'UTF8&#= 39;
=C2=A0=C2=A0 =C2=A0 =C2=A0 LC_COLLATE =3D 'Spanish= _Peru.1252'
=C2=A0=C2=A0 =C2=A0 =C2=A0 LC_CTYPE =3D 'Spanish_Peru.1252'=
=C2=A0=C2=A0 =C2=A0 =C2=A0 CONNECTION LIMIT =3D -1;

When I run the following commands in psql I get thi= s:
sbs=3D#SHOW SERVER_ENCODING;
server_encoding
---------------
U= TF8
(1 fila)

sbs=3D#SHOW C= LIENT_ENCODING;
client_encoding
---------= ------
UTF8
(1 fila)

The gen= erated file by propel that manages the database connection sets the charset= to utf8 too. The insertion fails only everytime I try to insert the curren= cy symbols such as =E2=82=AC, =C2=A5, =C2=A3, =E2=82=B1, etc. I have no pro= blem with symbols such S/., $, p., Q, L or any other non-special symbol. Th= e curious thing is that when I run the sentence INSERT INTO CURRENCY VALUES= (3,'EURO','=E2=82=AC'); using the query tool of pgAdminIII,= I got no error and the query was sucessfully executed. However running the= same sentence in psql, I got the row inserted but with ? instead of =E2=82= =AC as the currency symbol.
I think the utf8 is the apropiate charset to represent these symbols b= ut I have no idea why I'm getting this problem. I've spent the whol= e day struggling with this problem and I can't figure it out yet. I hav= e tried many things, none of them worked. So this is why I'm here askin= g for your help, as my last resource. Any guidance that could put me in the= right direction to address this problem will be really appreciated!

Thanks in advance and I'm sorry If I went on a bit = long...

--
Jorge Miranda Casta=C3=B1eda.

--0015175df19629f2540479cd8b64--