note 35065 added to function.xml-set-character-data-handler

From: Date: Mon, 18 Aug 2003 14:15:21 +0000
Subject: note 35065 added to function.xml-set-character-data-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-54585@lists.php.net to get a copy of this message
Thanks to Christian Stocker for clearing up my entity issues, where some entities are parsed correctly and others not. The problem is the ''wide'' entities that have a large numeric code simply can not fit in a single byte, which is the default encoding for both source input to the parser and data output from the parser. So the parser puts out a ''?'' to say it could not store the code value. One could argue that if the input has a &1234; the output should simply copy it as &1234; instead of the ''?'' but that would still mean the parser behaves two different ways according to the code values, and anyway they don't do it. So, we need utf8 encoding for the output, and the slightly not obvious way to say so is $xml_parser = xml_parser_create ("UTF-8"); which means BOTH source input and data output are utf8. Remember that utf8 is a superset of basic ASCII but not of extended ASCII, so your input can contain e.g. é spelled out, but a native eacute character is wrong here. Just utf8_encode your input to be sure. That should do it, and thanks again for the help. ---- Manual Page -- http://www.php.net/manual/en/function.xml-set-character-data-handler.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35065 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35065&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35065&report=yes

« previous php.notes (#54585) next »