Hi, I have a problem to see special characters (like "è,ò,ì…I see è), in flash when I load them from sql with php and xml.
Here my scripts:
AS3:
var myDomandaXML:XML = new XML();
var varDomande:URLRequest = new URLRequest(MyGlobal.LinkDomande);
varDomande.method = URLRequestMethod.POST;
var varLoaderDom:URLLoader = new URLLoader ;
varLoaderDom.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoaderDom.addEventListener(Event.COMPLETE, processDATIDom);
varLoaderDom.load(varDomande);
function processDATIDom(e:Event):void
{
var myDomandaXML = e.target.data;
myDomandaXML = unescape(myDomandaXML);
myDomandaXML = new XML(myDomandaXML);
// I tried to use this too
//myDomandaXML.useCodePage=true;
Domanda.text = myDomandaXML.DOMANDA;
PHP:
<?php
header("Content-Type: application/x-javascript; charset=ISO-8859-1");
#Include accesso a database
include_once "../config.php";
include "../query.php";
$query = mysql_query("SELECT * FROM domande WHERE ID = 1);
$row = mysql_fetch_array( $query );
echo "<?xml version =\"1.0\" encoding =\"UTF-8\"?>
";
echo "<TABELLA>
";
echo "<DOMANDA>".$row['domanda']."</DOMANDA>
";
echo "</TABELLA>
";
?>
I wrote in “row ‘domanda’” in database directly(just some example), collation is set to latin1_swedish_ci.
I tried to open php directly and I see characters correctly “è,ù” but in flash no…why? I’m going crazy…really…:s