I used simplexml to parse an RSS data source a while ago, and I easily got the results I wanted. I didn’t want to start reporting errors within a few days:
Warning: simplexml_load_file() [function.simplexml-load- file]: input conversion failed due to input error, bytes 0xAD 0xB5 0x3C 0x2F
At first I thought it was a bug in php5, but a search found that it was possible that the RSS source was mixed with characters of other encodings, causing simplexml parsing Error.
That is to say, if the RSS declaration is like this:
PLAIN TEXTXML:
Then the RSS content must be gb2312.
Solution
Use iconv to convert the encoding
Change the encoding to the correct encoding