HELP!!!! UNICODE problem

HELP!!!! UNICODE problem

am 26.04.2004 10:39:14 von fi94te02

Hello,

I am using postgresql and PHP to develop an application supporting
English/French/Arabic Data. I am using PHP5RC1 and Postgresql 7.4.2

When the user enters french caracters (=E9,=E8,...) I get the followi=
ng error.

====================

Warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid
byte sequence for encoding "UNICODE": 0xe96d61 in
/usr/local/apache2/htdocs/Classes/DBAdapter.class.php on line 27
====================

I managed to save my SQL string into a file. When open with vi, the file =
reads
==============
update classe set code=3D'MATE',description=3D'Math=E9matiques
El=E9mentaires',cycle=3D'SEC',classesuperieure=3DNULL,info=3 DNULL where c=
ode=3D'MATE'
~
==============

whereas the command cat shows

==============
update classe set code=3D'MATE',description=3D'Math�matiques El=
5533;mentaires',cycle
=3D'SEC',classesuperieure=3DNULL,info=3DNULL where code=3D'MATE'
==============

I tried to figure out what to do; when I copy and paste the content of th=
e
file into the "psql" tool, it works perfectly and I can see the accented
letters in my browser; whereas the psql's command "\i " generat=
es
the same.

Any help would be appreciated

Regards
Dani Mezher


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Re: HELP!!!! UNICODE problem

am 27.04.2004 04:44:43 von Christopher Kings-Lynne

> ==============
> update classe set code='MATE',description='Math�matiques El�mentaires',cycle
> ='SEC',classesuperieure=NULL,info=NULL where code='MATE'
> ==============

That's happening because you have not correctly specified the page
encoding in the HTML page. So, Internet Explorer converts the entities
badly...

Chris


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Re: HELP!!!! UNICODE problem

am 27.04.2004 05:52:39 von vimala

Hi,
U could use urlencode if the method is get. Its its post, then
there will be no problem.

-vimala/.


On Mon, 26 Apr 2004 fi94te02@fi.usj.edu.lb wrote:

> Hello,
>
> I am using postgresql and PHP to develop an application supporting
> English/French/Arabic Data. I am using PHP5RC1 and Postgresql 7.4.2
>
> When the user enters french caracters (=E9,=E8,...) I get the follo=
wing error.
>
> ====================
>
> Warning: pg_query() [function.pg-query]: Query failed: ERROR: inval=
id
> byte sequence for encoding "UNICODE": 0xe96d61 in
> /usr/local/apache2/htdocs/Classes/DBAdapter.class.php on line 27
> ====================
>
> I managed to save my SQL string into a file. When open with vi, the fil=
e reads
> ==============
> update classe set code=3D'MATE',description=3D'Math=E9matiques
> El=E9mentaires',cycle=3D'SEC',classesuperieure=3DNULL,info=3 DNULL where=
code=3D'MATE'
> ~
> ==============
>
> whereas the command cat shows
>
> ==============
> update classe set code=3D'MATE',description=3D'Math�matiques El&=
#65533;mentaires',cycle
> =3D'SEC',classesuperieure=3DNULL,info=3DNULL where code=3D'MATE'
> ==============
>
> I tried to figure out what to do; when I copy and paste the content of =
the
> file into the "psql" tool, it works perfectly and I can see the accente=
d
> letters in my browser; whereas the psql's command "\i " gener=
ates
> the same.
>
> Any help would be appreciated
>
> Regards
> Dani Mezher
>
>
> ---------------------------(end of broadcast)--------------------------=
-
> TIP 8: explain analyze is your friend
>


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Re: HELP!!!! UNICODE problem

am 27.04.2004 19:54:06 von Dani Mezher

I added the following line in the head section of my html

8">
=00
but it still doesn't work. Actually, when I type arabic letters the=20
query executes but I get question marks instead of arabic text. French=20
characters
generate the error.

I installed a previous web server on my Mac OSX and it works with=20
french/arabic/english without any kind of specification of the document=20
encoding.

Regards
Dani

On Apr 26, 2004, at 7:44 PM, Christopher Kings-Lynne wrote:

>
>> ==============
>> update classe set code=3D'MATE',description=3D'Math�matiques=20
>> El�mentaires',cycle
>> =3D'SEC',classesuperieure=3DNULL,info=3DNULL where code=3D'MATE'
>> ==============
>
> That's happening because you have not correctly specified the page=20
> encoding in the HTML page. So, Internet Explorer converts the entities=20
> badly...
>
> Chris
>
>
> ---------------------------(end of=20
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Re: HELP!!!! UNICODE problem

am 28.04.2004 21:08:02 von Dani Mezher

Silly me... I forgot that the header in PHP was sent using the "header"
function. When I set the charset to utf-8, it worked perfectly.

Thanks
Dani

On Apr 27, 2004, at 10:54 AM, Dani Mezher wrote:

> I added the following line in the head section of my html
>
>
> but it still doesn't work. Actually, when I type arabic letters the
> query executes but I get question marks instead of arabic text. French
> characters
> generate the error.
>
> I installed a previous web server on my Mac OSX and it works with
> french/arabic/english without any kind of specification of the
> document encoding.
>
> Regards
> Dani
>
> On Apr 26, 2004, at 7:44 PM, Christopher Kings-Lynne wrote:
>
>>
>>> ==============
>>> update classe set code='MATE',description='MathA533;matiques
>>> El�mentaires',cycle
>>> ='SEC',classesuperieure=NULL,info=NULL where code='MATE'
>>> ==============
>>
>> That's happening because you have not correctly specified the page
>> encoding in the HTML page. So, Internet Explorer converts the
>> entities badly...
>>
>> Chris
>>
>>
>> ---------------------------(end of
>> broadcast)---------------------------
>> TIP 5: Have you checked our extensive FAQ?
>>
>> http://www.postgresql.org/docs/faqs/FAQ.html
>>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match