ID: 33375
Updated by: [EMAIL PROTECTED]
Reported By: frederic dot lecointre at burnweb dot net
-Status: Verified
+Status: Feedback
Bug Type: XML related
Operating System: *
PHP Version: 5CVS-2005-06-17
New Comment:
You have to define the encoding of the XML document in the XML
header (which is also the XML standard, if you don't do that,
it defaults to UTF-8). The xml_parser_create() parameter is
only for the output-encoding (since PHP 5). See the manual for
details.
Can you please try adding
<?xml version="1.0" encoding="ISO-8859-1"?>
to your XML document and see if it works?
Previous Comments:
------------------------------------------------------------------------
[2005-06-17 10:41:22] frederic dot lecointre at burnweb dot net
hi,
there's no more or less strict! ISO-8859-1 is ISO-8859-1 !
is there an active maintener for this extension ?
------------------------------------------------------------------------
[2005-06-17 10:20:52] [EMAIL PROTECTED]
This also causes the pear install fail in HEAD.
And this is because we now use libxml2 instead of expat where former is
more strict perhaps?
------------------------------------------------------------------------
[2005-06-17 02:27:09] frederic dot lecointre at burnweb dot net
Description:
------------
xml_parse return invalid character error with ISO-8859-1 data.
Reproduce code:
---------------
<?php
function startElement($parser, $name, $attribs){return true;}
function endElement($parser, $name){return true;}
$xml_string = '
<head>
<title>Frédéric</title>
</head>
';
$xml_parser = xml_parser_create('ISO-8859-1');
xml_set_element_handler($xml_parser, "startElement", "endElement");
if (!xml_parse($xml_parser, $xml_string, true)) {
die(sprintf("error : %s at line %d col %d\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser),
xml_get_current_column_number($xml_parser)));
}
?>
Actual result:
--------------
error : Invalid character at line 3 col 20
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33375&edit=1