Re: xml_parser_create patch
| From: | (Marcus Börger) | Date: | Wed, 07 May 2003 13:42:26 +0000 |
| Subject: | Re: xml_parser_create patch | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-1351@lists.php.net to get a copy of this message | ||
At 15:21 07.05.2003, Adam Dickmeiss wrote:
On Wed, May 07, 2003 at 03:02:17PM +0200, Marcus Börger wrote: At 12:55 07.05.2003, Adam Dickmeiss wrote:That was my point. Sure it is a good thing to not longer ignore the document but from perspective it is better to assume ISO-8859-1 if no eccoding was specified in the doc since we did that before. marcusOn Wed, May 07, 2003 at 11:59:24AM +0200, Marcus Börger wrote:Iirc then before the change every one supposes that ISO-8859-1 will be handled. So that should be the default. In other words we should do BC. BC. Fine. I don't think you understand what I'm trying to achieve with this fix. Suppose I have an XML document that looks like this: <?xml version="1.0" encoding="UTF-8"?> <something/> and I call xml_parser_create() without arguments, then Expat (without my fix) will assume that the document uses default encoding which currently is ISO-8859-1. So really, there is nothing default about it. Since it ignores the encoding in the XML document, it should probably be called force_encoding (or similar:) The only place where specifying an encoding makes sense is if you parse XML files with no encoding attribute at all in them. And frankly, even assuming ISO-8859-1 there, is bad. UTF-8 should be default. But that's another issue.Then tell me . What would that default value be? What I want a way to let the XML document tell my Expat XML parser what encoding it's using..At 11:43 07.05.2003, Adam Dickmeiss wrote:[...] Note that this patch _may_ break applications that assumes ISO-8859-1 (or default encoding) for XML applications, but only if the application omitted a desired encoding for xml_parser_create.Then why not make it the default value ?