Document labelled UTF-16 but has UTF-8 content in Entity PHP error

前端 未结 1 1849
遇见更好的自我
遇见更好的自我 2020-12-21 08:12

I recently transferred my site to PHP5.3 from PHP5.2. I had in place an authentication module which was working fine earlier but now gives the error

Document         


        
相关标签:
1条回答
  • 2020-12-21 08:50

    See this:

    http://forums.devshed.com/php-development-5/document-labelled-utf-16-but-has-utf-8-content-694388.html

    Solution from this link simply replaces encoding information in the XML code:

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

    Not a nice solution, but worked for OP.

    0 讨论(0)
提交回复
热议问题