pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedHELP!!!! UNICODE problem
5+ messages / 4 participants
[nested] [flat]
* HELP!!!! UNICODE problem
@ 2004-04-26 08:39 fi94te02@fi.usj.edu.lb
2004-04-27 02:44 ` Re: HELP!!!! UNICODE problem Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2004-04-27 03:52 ` Re: HELP!!!! UNICODE problem Vimala S.P. <vimala@ncb.ernet.in>
0 siblings, 2 replies; 5+ messages in thread
From: fi94te02@fi.usj.edu.lb @ 2004-04-26 08:39 UTC (permalink / raw)
To: pgsql-php
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 (é,è,...) I get the following 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='MATE',description='Mathématiques
Elémentaires',cycle='SEC',classesuperieure=NULL,info=NULL where code='MATE'
~
==============
whereas the command cat shows
==============
update classe set code='MATE',description='Math�matiques El�mentaires',cycle
='SEC',classesuperieure=NULL,info=NULL where code='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 accented
letters in my browser; whereas the psql's command "\i <filename>" generates
the same.
Any help would be appreciated
Regards
Dani Mezher
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: HELP!!!! UNICODE problem
2004-04-26 08:39 HELP!!!! UNICODE problem fi94te02@fi.usj.edu.lb
@ 2004-04-27 02:44 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2004-04-27 17:54 ` Re: HELP!!!! UNICODE problem Dani Mezher <dany.mezher@fi.usj.edu.lb>
1 sibling, 1 reply; 5+ messages in thread
From: Christopher Kings-Lynne @ 2004-04-27 02:44 UTC (permalink / raw)
To: fi94te02@fi.usj.edu.lb; +Cc: pgsql-php
> ==============
> 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: HELP!!!! UNICODE problem
2004-04-26 08:39 HELP!!!! UNICODE problem fi94te02@fi.usj.edu.lb
2004-04-27 02:44 ` Re: HELP!!!! UNICODE problem Christopher Kings-Lynne <chriskl@familyhealth.com.au>
@ 2004-04-27 17:54 ` Dani Mezher <dany.mezher@fi.usj.edu.lb>
2004-04-28 19:08 ` Re: HELP!!!! UNICODE problem Dani Mezher <dany.mezher@fi.usj.edu.lb>
0 siblings, 1 reply; 5+ messages in thread
From: Dani Mezher @ 2004-04-27 17:54 UTC (permalink / raw)
To: pgsql-php
I added the following line in the head section of my html
<meta http-equiv="Content-Type" content="text/html; charset=utf-8>
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='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
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: HELP!!!! UNICODE problem
2004-04-26 08:39 HELP!!!! UNICODE problem fi94te02@fi.usj.edu.lb
2004-04-27 02:44 ` Re: HELP!!!! UNICODE problem Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2004-04-27 17:54 ` Re: HELP!!!! UNICODE problem Dani Mezher <dany.mezher@fi.usj.edu.lb>
@ 2004-04-28 19:08 ` Dani Mezher <dany.mezher@fi.usj.edu.lb>
0 siblings, 0 replies; 5+ messages in thread
From: Dani Mezher @ 2004-04-28 19:08 UTC (permalink / raw)
To: Dani Mezher <dany.mezher@fi.usj.edu.lb>; +Cc: pgsql-php
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
>
> <DEFANGED_meta http-equiv="Content-Type" content="text/html;
> charset=utf-8">
> 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)
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: HELP!!!! UNICODE problem
2004-04-26 08:39 HELP!!!! UNICODE problem fi94te02@fi.usj.edu.lb
@ 2004-04-27 03:52 ` Vimala S.P. <vimala@ncb.ernet.in>
1 sibling, 0 replies; 5+ messages in thread
From: Vimala S.P. @ 2004-04-27 03:52 UTC (permalink / raw)
To: fi94te02@fi.usj.edu.lb; +Cc: pgsql-php
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 (é,è,...) I get the following 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='MATE',description='Mathématiques
> Elémentaires',cycle='SEC',classesuperieure=NULL,info=NULL where code='MATE'
> ~
> ==============
>
> whereas the command cat shows
>
> ==============
> update classe set code='MATE',description='Math�matiques El�mentaires',cycle
> ='SEC',classesuperieure=NULL,info=NULL where code='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 accented
> letters in my browser; whereas the psql's command "\i <filename>" generates
> the same.
>
> Any help would be appreciated
>
> Regards
> Dani Mezher
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2004-04-28 19:08 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-26 08:39 HELP!!!! UNICODE problem fi94te02@fi.usj.edu.lb
2004-04-27 02:44 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2004-04-27 17:54 ` Dani Mezher <dany.mezher@fi.usj.edu.lb>
2004-04-28 19:08 ` Dani Mezher <dany.mezher@fi.usj.edu.lb>
2004-04-27 03:52 ` Vimala S.P. <vimala@ncb.ernet.in>
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