...

AJAX-PHP with UTF-8

javascriptbank
06-26-2007, 10:27 AM
I use AJAX to load PHP page, but Unicode characters are displayed by square characters, I don't know how to fix it?

Anyone know how to fix it? Please show me. Thank you very much first

ess
06-26-2007, 02:40 PM
Sounds like a charset issue

If you are using xml files, you should always declare the charset...for example

<?xml version="1.0" encoding="|ISO-8859-1|"?>

If it is a HTML file, you should try and
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

You can also apply these settings via PHP.
<?php
header('Content-type: text/xml); // if you are using xml
header('Content-type: text/html); // if you are using html
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

Cheers,
Ess



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum