Re: Problems with UTF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter,

I am returning XML from my php script so I should use the charset in my XML
header?

The database (which holds the data) should be set to utf8 and the same thing
in the XML header, right?

On 8/28/06, Peter Lauri <lists@xxxxxxxxxxx> wrote:

Hi,

Have you set

header('Content-Type: text/html; charset=utf-8');

in your php script that you call via AJAX?

Best regards,
Peter

PS! I assumed you were not sending any variables with the AJAX request? If
so, you would need to do an utf-8 encoding of the variables and then a
base64 encoding to make sure the arrive correctly. Of course you would
after
that need to decode the variables with base64_decode in your PHP script
DS!


-----Original Message-----
From: mbneto [mailto:mbneto@xxxxxxxxx]
Sent: Tuesday, August 29, 2006 2:57 AM
To: php-general@xxxxxxxxxxxxx
Subject:  Problems with UTF

Hi,

I have a php based script that is called from a html page via ajax.
Everything runs fine except when I use characters such as á that ends up
like A!

After searching and testing I found that if I remove the
encodeURIComponentfrom the javascript and replace with
escape everything works fine.

So the question is what can I do from PHP side to make it play nice with
those UTF encoded chars generated from encodeURIComponent?  Since escape
is
deprecated I'd like to find out before I have tons of files to change....

tks.



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux