As3 & PHP URLEncoding problem!
Posted
by Jk_
on Stack Overflow
See other posts from Stack Overflow
or by Jk_
Published on 2010-05-30T07:55:13Z
Indexed on
2010/05/30
8:02 UTC
Read the original article
Hit count: 221
Hi everyone,
I'm stuck with a stupid problem of encoding.
My problem is that all my accentuated characters are displayed as weird iso characters.
Example : é is displayed %E9
I send a string to my php file :
XMLLoader.load(new URLRequest(online+"/query.php?Query=" + q));
XMLLoader.addEventListener(Event.COMPLETE,XMLLoaded);
When I trace q, I get :
"INSERT INTO hello_world (message) values('éàaà');"
The GOOD query
My php file look like this :
<?php
include("conection.php");//Conectiong to database
$Q = $_GET['Query'];
$query = $Q;
$resultID = mysql_query($query) or die("Could not execute or probably SQL statement malformed (error): ". mysql_error());
$xml_output = "<?xml version=\"1.0\"?>\n"; // XML header
$xml_output .= "<answers>\n";
$xml_output .= "<lastID id=".'"'.mysql_insert_id().'"'." />\n";
$xml_output .= "<query string=".'"'.$query.'"'." />\n";
$xml_output .= "</answers>";
echo $xml_output;//Output the XML
?>
When I get back my XML into flash the $query looks like this :
"INSERT INTO hello_world (message) values('%E9%E0a%E0');"
And these values are then displayed into my DB which is annoying.
Any help would be appreciated! Cheers.
Jk_
© Stack Overflow or respective owner