I have this little piece of code, reading a very easy affiliate XML. The URL is http://pf.tradetracker.net/?aid=193104&encoding=iso-8859-1&type=xml-v2&fid=556821&r=tt-canvasholidays.nl&categoryType=2&additionalType=2
When I try to put this XML in an array and process it with some basic functions, it seems that special characters are being replaced by encoded ones.
For example the word Château
in the original XML is replaced by Château
when I read the XML in my php as follows:
$xml = simplexml_load_file($file);
foreach($xml->product as $child) {
$name = mysql_real_escape_string($child->name);
}
Had programmed an escape function that replaces most of the Ãx
-things with the correct characters, but the "â
" string seems to be not accepted in the php code.
I have read some articles about wrong database conversion, but I'm just reading and interpreting it from the source XML and in the simplexml_load_file
is no encoding specified.
O btw, I'm not a very experienced php programmer, but just stuck to Wordpress in combination with proven technologies for affiliate productfeeds, until some French data was coming through :)
Hope you can help... Thanks in advance...
");` – rodney Apr 15 '15 at 06:23