Summary: | The XML parser doesn't (always) default to UTF-8 when HTTP charset or encoding declaration is lacking | ||
---|---|---|---|
Product: | WebKit | Reporter: | Leif Halvard Silli <xn--mlform-iua> |
Component: | XML | Assignee: | Nobody <webkit-unassigned> |
Status: | UNCONFIRMED --- | ||
Severity: | Major | CC: | annevk, ap |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://malform.no/testing/html5/bom/normal-XML-BOMless-HTTPcharsetLESS | ||
Bug Depends on: | |||
Bug Blocks: | 66106 |
Description
Leif Halvard Silli
2011-08-11 07:16:37 PDT
A special case of this bug is when ""an XML document may be in a subframe inside an HTML one"" - see bug 66056#c13 Test page - HTML page with XHTML subframe: <http://malform.no/testing/html5/bom/frame> Results: Webkit lets the XHTML page inherit the encoding from the HTML page ... IE9 and Firefox do not have this bug. For reference: Subframe served as HTML <http://malform.no/testing/html5/bom/frame4> Results: Now, Webkit respects the encoding declaration of the subframe Firefox and IE6 to IE9 behaves like Webkit, except that they do not have bug 17873 ("Encoding override should not be persistent") Comment: It is quite weird that the HTML page works better and safer (when it comes to encoding) than the XHTML file. And the only reason for this weirdness is because Webkit does not follow XML 1.0's encoding rules. Another instance of the same problem is SVG files (and MathML files) which may contain non-ASCII and non-WINDOWS-1252 text. Test page: http://malform.no/testing/html5/bom/frame5 Features of the HTML page: a) Windows-1252, b) contains <iframe>, <img> and <object> with the same SVG file in each c) SVG file features: * UTF-8 encoded, but without encoding declaration or BOM. * Text of the SVG file is 'Hello, world!" in Russian (Cyrillic). EXPECTED RESULTS: That the SVG file is rendereds the same way, regardless of whether it is referenced from the <iframe> element, the <img> element or the <object> element. ACTUAL RESULTS: Only when occuring inside the <img> file, does the SVG work as expected. |