From: giunta_gaetano at libero dot it Operating system: windows 2000 PHP version: 5.1.2 PHP Bug Type: XML related Bug description: xml_parse return invalid character error with ISO-8859-1 data
Description: ------------ PLEASE REOPEN AND FIX BUG #33375! It bewilders me that this has not yet been fixed in php 5.2.1... It is a BC breakage against PHP 4, and makes very very little sense anyway: - xml does NOT mandate a charset specification in the prologue - other communication/storage layers impose DIFFERENT standards on charset declarations and default charset values that the xml spec does by itself to be more clear, a common example: - received xml message has no charset in the prologue - it is received over HTTP, and the http content-type header states a charset (it is authoritative, according to the specs) - there is no way to tell the xml parser to use the correct charset for parsing the message! Why on earth was it not decided, when switching to libxml, that xml_parser_create() would get some automagic new powers, while xml_parser_create('ISO-8859-1') would be 100% backwards compatible and let the coder specify a source charset??? PS: at least fix the manual, and clearly specify that in order for the 'magical charset detection' to work, the xml prologue MUST contain a charset declaration!!! PPS: last but not least: the column number where the error is found (xml_get_current_column_number()) is also borked: whereas with php 4 the error reported the column corresponding to the first non-ascii char found, with php 5 the error reports the column where the xml element closing tag starts, which is a bit misleading... Reproduce code: --------------- Just try to parse any ISO-8859-1 xml file that has no charset specified in the prologue. Expected result: ---------------- no error Actual result: -------------- a dumb parsing error -- Edit bug report at http://bugs.php.net/?id=36785&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36785&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36785&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36785&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36785&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36785&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36785&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36785&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36785&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36785&r=support Expected behavior: http://bugs.php.net/fix.php?id=36785&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36785&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36785&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36785&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36785&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36785&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36785&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36785&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36785&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36785&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36785&r=mysqlcfg