Bug #12707 Updated: xml_parse_into_struct ignores XML_OPTION_TARGET_ENCODING

From: Date: Sun, 12 Aug 2001 18:37:34 +0000
Subject: Bug #12707 Updated: xml_parse_into_struct ignores XML_OPTION_TARGET_ENCODING
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-62987@lists.php.net to get a copy of this message
ID: 12707 Updated by: thies Reported By: php@nichtich.de Old Status: Open Status: Closed Bug Type: XML related Operating System: Linux PHP Version: 4.0.6 New Comment: fixed in CVS Previous Comments: ------------------------------------------------------------------------ [2001-08-12 10:57:28] php@nichtich.de xml_parse_into_struct does not seem to encode the name of tags in UTF-8 ignoring the XML_OPTION_TARGET_ENCODING you specified with xml_parser_set_option. You reproduce the problem (using ISO-8859-1) with the following script: <? $xmldata = "<?xml version='1.0' encoding='ISO-8859-1'?><äöü>ÄÖÜ</äöü>"; $parser = xml_parser_create('ISO-8859-1'); // i want ISO-8859-1 !! xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING,"ISO-8859-1"); xml_parse_into_struct($parser, $xmldata, $struct, $index); // need do decode tag names manually like this :-( // foreach (array_keys($struct) as $index) // $struct[$index]['tag']= utf8_decode(&$struct[$index]['tag']); // the name 'äöü' is not encoded correctly echo "<h1>Struct</h1><pre>"; print_r($struct); echo "</pre>"; ?> ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12707&edit=1

« previous php.dev (#62987) next »