hello,
i've a xml-file with a latin-1 encoding (encoding=iso-8859-1)
i am parsing it using php:
// what are we parsing?
$xml_file = '../database/panco-external-iso.xml' ;
// declare the character set - UTF-8 is the default
$type = 'iso-8859-1' ;
// create our parser
$xml_parser = xml_parser_create ($type);
// set some parser options
xml_parser_set_option ($xml_parser , XML_OPTION_CASE_FOLDING , true );
xml_parser_set_option ($xml_parser , XML_OPTION_TARGET_ENCODING , $type );
// this tells PHP what functions to call when it finds an element
// these funcitons also handle the element's attributes
xml_set_element_handler ($xml_parser , 'startElement' ,'endElement' );
// this tells PHP what function to use on the character data
xml_set_character_data_handler ($xml_parser , 'characterData' );
so you can see, i am using iso-8859-1 in the xml-file and in the parser. although the umlaute (ä, ü, ö) are not returned correctly (although they are okay, if i look at the file using VI):
"Kürbis" becomes "KÃ1?4rbis" and so on.
has anybody an idea, what i am doing wrong? do i've to save the file in a special way or something?
thanks in advance
stefan