I'm having troubles getting the euro sign through an XML parser.
With the following test code:
<?php
$string = "<root><test>€</test></root>";
$parser = xml_parser_create();
xml_set_character_data_handler( $parser, 'cdata' );
xml_set_element_handler( $parser, 'starthandler', 'endhandler' );
if( !xml_parse( $parser, $string ) ) {
print xml_error_string( xml_get_error_code( $parser ));
}
function cdata( $p, $data ) {
print $data."\n";
}
function starthandler( $p, $tag, $att ) {
// print $tag."\n";
}
function endhandler( $p, $tag ) {
// print $tag."\n";
}
?>
I get the following result for $string
$string = "<root><test>€</test></root>";
?
$string = "<root><test>€</test></root>";
?
$string = "<root><test>€</test></root>";
Undeclared entity error
Any solutions to this problem?
Rutger Claes
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Do not reply to the from address. It's read by /dev/null and sa-learn only