PHP 4.0 Bug #6146: xml_parse() passes character entities incorrectly

From: Date: Mon, 14 Aug 2000 11:45:20 +0000
Subject: PHP 4.0 Bug #6146: xml_parse() passes character entities incorrectly
Groups: php.dev 
Request: Send a blank email to php-dev+get-28806@lists.php.net to get a copy of this message
From: sniper@php.net Operating system: Sun Solaris 2.6 PHP version: 4.0 Latest CVS (14/08/2000) PHP Bug Type: Other Bug description: xml_parse() passes character entities incorrectly Here are an example xml-file and php-script which demonstrates this behaviour: --------- <?xml version="1.0" ?> <document> <test1>åäöÅÄÖ</test1> <test2>&#229;&#228;&#246;&#197;&#196;&#214;</test2> </document> --------- <?php $file = "test.xml"; function characterData($parser, $data) { print "*$data*<br>"; } $xml_parser = xml_parser_create(); xml_set_character_data_handler($xml_parser, "characterData"); if (!($fp = fopen($file, "r"))) { die("could not open XML input"); } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } ?> ----------------- php configure line: ./configure --prefix=/data --with-config-file-path=/data/conf --with-mysql=/data/kolumbustori --without-gd --disable-pear --disable-debug And the output with those files: * * * * *åäöÅÄÖ* * * * * *å* *ä* *ö* *Å* *Ä* *Ö* * * --Jani

« previous php.dev (#28806) next »