XML error: Input is not proper UTF-8, indicate encoding ! after change from PHP5 to PHP7

XML error: Input is not proper UTF-8, indicate encoding ! after change from PHP5 to PHP7

我的 XML 文件中的 Chrome 出现错误:从 PHP 5 升级到 7 后 https://media.mostrami.pl/feed/zanox.xml?asdfsadfa

error on line 148745 at column 26: Input is not proper UTF-8, indicate encoding !
Bytes: 0xC4 0x87 0x20 0x6A

我使用 xmllint 验证了文件,没有收到任何错误。 我很确定内容是 UTF-8 格式的(在 PHP5 中工作正常,由 xmllint 验证,由文件 -I xml_filename)

检查

怎么了?

相信你遇到过streamed XML parsing bug in chrome。错误将指向 XML 标记的开头,但实际上“错误”在内容中的某个地方。这是因为服务器以块的形式响应,其中一个块在多字节 UTF 字符的中间被分割。