|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-02-15 08:51 UTC] thies@php.net
[2001-02-19 06:03 UTC] sniper@php.net
[2001-02-19 06:30 UTC] thies@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 03:00:01 2025 UTC |
Here are an example xml-file and php-script which demonstrates this behaviour: --------- <?xml version="1.0" ?> <document> <test1>??????</test1> <test2>åäöÅÄÖ</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