- xml_set_character_data_handler: documentation ( source)
- xml_parse: documentation ( source)
- xml_parser_set_option: documentation ( source)
- xml_parser_create: documentation ( source)
<?php
// testutf8.php
function dataEcho( $parser, $data ) {
echo "$data";
}
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'iso-8859-1');
xml_set_character_data_handler(
$parser,
'dataEcho'
);
xml_parse( $parser, '<?xml version="1.0" encoding="iso-8859-1"?><svg xmlns="http://www.w3.org/2000/svg"><title>dÜST</title></svg>' );
echo "\n";