foreach($xml_matches[0] as $xml_index => $xml_package) {
$i = 0;
- $p = xml_parser_create($encoding);
+
+ switch(strtolower($encoding)) {
+ case 'iso-8859-1':
+ case 'utf-8':
+ $p = xml_parser_create($encoding);
+ break;
+
+ default:
+ $p = xml_parser_create('');
+ }
+
xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);
@xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, LANG_CHARSET);
$xml_package = $xml_string . "\n" . $xml_package;
$val = &$this->cleanup_val;
// Instead of nasty regex-mangling we use the XML parser to get the attribute list of our input tag
- $p = xml_parser_create(LANG_CHARSET);
+ switch(strtolower(LANG_CHARSET)) {
+ case 'iso-8859-1':
+ case 'utf-8':
+ $p = xml_parser_create(LANG_CHARSET);
+ break;
+
+ default:
+ $p = xml_parser_create('');
+ }
+
@xml_parse_into_struct($p, $data[0], $vals, $index);
xml_parser_free($p);