文档标记为UTF-16但在Entity PHP错误中具有UTF-8内容 [英] Document labelled UTF-16 but has UTF-8 content in Entity PHP error
本文介绍了文档标记为UTF-16但在Entity PHP错误中具有UTF-8内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近将我的网站从PHP5.2转移到PHP5.3。我有一个认证模块,它工作正常早,但现在给出错误
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 labelled UTF-16 but has UTF-8 content in Entity
我已经尝试用UTF-16替换所有出现的UTF-没有帮助。
I have tried replacing all occurrences of UTF-8 with UTF-16 but that did not help. What could be the possible solutions / causes of this error?
推荐答案
请参阅:
此链接的解决方案只是替换XML代码中的编码信息:
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);
不是一个好的解决方案,但是为OP工作。
Not a nice solution, but worked for OP.
这篇关于文档标记为UTF-16但在Entity PHP错误中具有UTF-8内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文