#39565 [NEW]: xmlparser and accentuated letters

From: Date: Tue, 21 Nov 2006 02:16:32 +0000
Subject: #39565 [NEW]: xmlparser and accentuated letters
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105231@lists.php.net to get a copy of this message
From: sotiwin at freemail dot hu Operating system: Windows XP PHP version: 5.2.0 PHP Bug Type: XML related Bug description: xmlparser and accentuated letters Description: ------------ I want to parse an xml, with accentuated letters, but the parser cuts the characters before the first accentuated letter of each 'characterData'. I use Wamp5 with php 5.1.6. Reproduce code: --------------- <meta http-equiv="Content-type" value="text/html; charset=ISO-8859-1" /> <?php function characterData($parser, $data) { echo $data.'1'; } $data='<?xml version="1.0" encoding="ISO-8859-1"?><book>Exampleéá</book>'; echo 'XML input:<br>'.$data; $xml_parser = xml_parser_create('ISO-8859-1'); xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE,1); xml_set_character_data_handler($xml_parser,'characterData'); echo '<br>Parsed data:<br>'; if (!xml_parse($xml_parser, $data)) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } xml_parser_free($xml_parser); ?> Expected result: ---------------- characterData could have run only once. XML input: Exampleéá Parsed data: Exampleéá1 Actual result: -------------- characterData could have runs twice. XML input: Exampleéá Parsed data: Example1éá1 -- Edit bug report at http://bugs.php.net/?id=39565&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39565&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39565&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39565&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39565&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39565&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39565&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39565&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39565&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39565&r=support Expected behavior: http://bugs.php.net/fix.php?id=39565&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39565&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39565&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39565&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39565&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39565&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39565&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39565&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39565&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39565&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39565&r=mysqlcfg

« previous php.bugs (#105231) next »