Bug #74909 [Opn->Fbk]: XMLReader reports "Input is not proper UTF-8" on long Chinese strings

From: Date: Mon, 02 Apr 2018 16:06:10 +0000
Subject: Bug #74909 [Opn->Fbk]: XMLReader reports "Input is not proper UTF-8" on long Chinese strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214566@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74909&edit=1 ID: 74909 Updated by: cmb@php.net Reported by: lilydjwg at gmail dot com Summary: XMLReader reports "Input is not proper UTF-8" on long Chinese strings -Status: Open +Status: Feedback Type: Bug Package: XML Reader Operating System: Arch Linux x86_64 PHP Version: 7.1.7 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: I cannot reproduce this issue with libxml2 2.9.4+dfsg1-2.2+deb9u1. Could you please provide the XML document for download? Previous Comments: ------------------------------------------------------------------------ [2017-07-12 09:40:43] lilydjwg at gmail dot com Description: ------------ The error position is at the last character (\xef\xbc\x8c in UTF-8). If I make the string longer, the position doesn't change. If I make it one character shorter than the example, the error disappears. I've read bug #72181 but can't reproduce that one. My libxml2 version is 2.9.4+96+gfb56f80e-1 The XML doc for testing: <?xml version="1.0" encoding="UTF-8"?> <properties> 制馬吃富不國助病以孩上容留消生強德,準大指總產如戰上是個!沒目人起如物對了話外多年至性己外頭出假。在館演量難調代什如常千苦友議,學字而的響過紙看正家!玩車一,是華是體過記用說感公媽間城石也都於教行,獲驚稱重眼發工,層上由的間近要過將去資球我老來許推、種得海在中個產程的治教他院一;持一建情。你室隊花……放成動, </properties> Test script: --------------- <?php $reader = new XMLReader(); $reader->open("a.xml"); while($reader->read()) { } Actual result: -------------- PHP Warning: XMLReader::read(): /home/lilydjwg/tmp/a.xml:3: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xEF 0xBC EOF in /home/lilydjwg/.cache/tmp/a.php on line 4 PHP Warning: XMLReader::read(): 在中個產程的治教他院一;持一建情。你室隊花……放成動 in /home/lilydjwg/tmp/a.php on line 4 PHP Warning: XMLReader::read(): ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74909&edit=1

« previous php.bugs (#214566) next »