Page 1 of 1

Problems with AJAX encoding?

Posted: Tue Mar 24, 2009 6:11 am
by Birokrat
The php script returning the resultset is:

Code: Select all

$result = mysql_query($sql);
 
while($row=mysql_fetch_array($result))
{
echo "The cyrilic text: <b style="color:#BAB918;">'.$row['TYPE'].'</b>"
}
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.