Code: Select all
xml_parser_set_option ($xml_parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');Code: Select all
xml_parser_set_option ($xml_parser, XML_OPTION_TARGET_ENCODING, 'ISO8859-1');Code: Select all
xml_parser_set_option ($xml_parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');Code: Select all
xml_parser_set_option ($xml_parser, XML_OPTION_TARGET_ENCODING, 'ISO8859-1');So I think the short answer is that there is not great short answer...The optional encoding specifies the character encoding for the input/output in PHP 4. Starting from PHP 5, the input encoding is automatically detected, so that the encoding parameter specifies only the output encoding. In PHP 4, the default output encoding is the same as the input charset. If empty string is passed, the parser attempts to identify which encoding the document is encoded in by looking at the heading 3 or 4 bytes. In PHP 5.0.0 and 5.0.1, the default output charset is ISO-8859-1, while in PHP 5.0.2 and upper is UTF-8. The supported encodings are ISO-8859-1, UTF-8 and US-ASCII.
Code: Select all
/* XML definitaion */
$xml = xml_parser_create('UTF-8');
$linkxml = serendipity_utf8_encode($this->get_config('links'));
xml_parse_into_struct($xml, '<list>' . $linkxml . '</list>', $struct, $index);
xml_parser_free($xml);Code: Select all
function decode($string) {
if (LANG_CHARSET != 'UTF-8') {
return utf8_decode($string);
}
return $string;
}Code: Select all
$str .= 'd.add('.$j.','.$level[count($level)-1].',"'.$this->decode($struct[$i]['attributes']['NAME']).'");'."\n";