note 52324 added to function.xml-parser-create
| From: | dma05 at web dot de | Date: | Wed, 27 Apr 2005 21:54:26 +0000 |
| Subject: | note 52324 added to function.xml-parser-create | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88662@lists.php.net to get a copy of this message | ||
xml_parser_create () on php5 sometimes detects the wrong input format for me -- for example,
sometimes when i try to parse data that has been fetched from a databse by my script and that only
contains a handful of special ISO-8859-1 characters, it seems to think the input was something else
and xml_parse() chokes on things like umlauts.
the only reason i was able to figure out so far would be that -- unlike my data files -- the xml
data generated by my script doesn't contain the <?xml [...] encoding="..." ?>
definition. every data source with that definition seemed just fine; it's kinda odd that it
worked *sometimes* without it *shrugs*.
no matter what the reason, using utf8_encode () on the string made it work, and prepending
'<?xml version="1.0" encoding="ISO-8859-1" ?>' worked as well.
this problem shouldn't occur in php4, since there you would specify the input encoding along
with the output encoding.
----
Manual Page -- http://www.php.net/manual/en/function.xml-parser-create.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52324
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52324&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52324&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52324&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52324&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52324&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52324&report=yes
Search -- http://master.php.net/manage/user-notes.php