Re: Bundling libxml2 default?
| From: | Adam Dickmeiss | Date: | Fri, 16 May 2003 21:00:43 +0000 |
| Subject: | Re: Bundling libxml2 default? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-1619@lists.php.net to get a copy of this message | ||
On Fri, May 16, 2003 at 07:00:32PM +0200, Adam Dickmeiss wrote:
> On Fri, May 16, 2003 at 11:20:53AM -0400, Sterling Hughes wrote:
[snip]
> > Err, that's not how it works in CVS at least:
> >
> > xml/compat.c - 279
> >
> > parser->parser->encoding = xmlStrdup(encoding);
> Yes. That's what it does . Question is, what it means
> for libxml2. Does it mean input encoding? Are you allowed
> to tamper with the encoding member in the parser struct at all?
> It could be that the encoding is _set_ by libxml2 to hold
> the actual encoding of the XML record.. We should check
> the libxml doc.
>
> I also noticed another issue with libxml. xml_parser_create
> fails for an XML record using UTF-16 encoding. That's
> even more strange, because libxml does support it. At least xmllint
> (part of libxml2) does not reject the XML file itself.
I looked at this issue a little, and I think that libxml
refuses to decode UTF-16 files (in compat.c) is due to the fact
xmlCreatePushParserCtxt is not called with the leading 4 bytes
of the XML file. So my thought was that maybe it's best to defer
calling that function until XML_Parse is called the first time.
XML_ParserCreate_MM would just do
parser->parser = 0;
to indicate that parser context is not yet there.
I don't supply a patch, since it doesn't yet work. If anybody
has input on this issue that'd be nice.
-- Adam