Problems with AJAX encoding?
Posted: Tue Mar 24, 2009 6:11 am
The php script returning the resultset is:
When I use header('Content-Type: text/xml; charset=windows-1251') the data pulled from the databse using the utf8_unicode_ci has been replaced with some random characters and the cyrilic text embedded in the echo function is displayed fine.
but when i set header to header('Content-Type: text/xml; charset=utf-8')
I get the reverse effect the data pulled from the databse is correct and the cyrilic text is replaced with questionmarks.
Sorry for my English.
Regards.
Code: Select all
$result = mysql_query($sql);
while($row=mysql_fetch_array($result))
{
echo "The cyrilic text: <b style="color:#BAB918;">'.$row['TYPE'].'</b>"
}but when i set header to header('Content-Type: text/xml; charset=utf-8')
I get the reverse effect the data pulled from the databse is correct and the cyrilic text is replaced with questionmarks.
Sorry for my English.
Regards.