Open Bug 1110695 Opened 10 years ago Updated 2 years ago

Automatic content detection doesn't work for XML Files with Byte Order Mark (BOM)

Categories

(Firefox :: File Handling, defect)

34 Branch
x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: frog23, Unassigned)

Details

Attachments

(3 files)

Prerequisites: 
 1. you have an XML-File (starting with <?xml version="1.0" encoding="utf-8"?>) encoded in UTF-8 with a byte order mark (BOM)
 2. that file has an extension other than *.xml
 3. the server delivers this file without a Content-Type header
 
Firefox does not recognize it as XML File and displays it as plain text ( see http://frog23.net/development/Firefox_Bug_XML_with_BOM.xyz ), whereas the same file without the byte order mark is displayed as XML (http://frog23.net/development/Firefox_Bug_XML_without_BOM.xyz ). 

Both files should be displayed as XML, since the file with BOM is a valid XML file and the content detection should also work for it. 

The two demo files, also serve as a reminder that bug 175946 is still not fixed.
When reproducing the bug on your own server, keep in mind that some servers are configured to always add a Content-Type when delivering a file and if the file extension is unknown then "text/plain" is delivered. So if this file is not displayed as XML when you have it on your own server, check the Content-Type header (either using the addon HTTP Resource Text [https://addons.mozilla.org/firefox/addon/http-resource-test/] or sites like http://hurl.it )

This bug equally affects opening XML files named differently on local filesystem. Reproduced in Firefox 85.0b6.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: