I have a XML file that I parse .. I didn’t generate the XML .. I faced a problem while parsing the file … There is a node that has ' single quotes .. This generates errors ..
I tried using addslashes() and htmlentities() when using simplexml_load_file() but nothing happened!! .. Is there a way to resolve this and parse the file with the quotes??
Warning: simplexml_load_file() [function.simplexml-load-file]: THE URL:853: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE2 0x20 0x20 0x6C in /****/parseXML.php on line 7
It sounds like you have an encoding problem. The single quotes are likely not the single quote character as found on your keyboard but rather a fancier one generated by a word pressing program. The result is likely that your input file is not UTF-8, but rather another multibyte character set.
You either need to convert the encoding with a text editor to make the file completely UTF-8, or use PHP’s iconv to convert from the encoding of the file (probably ISO-8859-1) to UTF-8 encoding and then load it with simplexml_load_string.