Wednesday, October 9, 2013

DOMDocument cannot parse XML: Document labelled UTF-16 but has UTF-8 content

1.screenshots

when i get this url's rss data:

http://ipaper.ipapercms.dk/AfricanShareHolder/za/CVI/2002/RSS.ashx



2.error:

DOMDocument cannot parse XML: Document labelled UTF-16 but has UTF-8 content

fixed: see here:

$xml = preg_replace('/(<\?xml[^?]+?)utf-16/i', '$1utf-8', $xml);  
 

No comments: