Report UTF-16LE or UTF-16BE instead of UTF-16 as the BOM-sniffed encoding

RESOLVED FIXED in mozilla28

Status

()

Core
HTML: Parser
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: hsivonen, Assigned: hsivonen)

Tracking

(Blocks: 1 bug)

unspecified
mozilla28
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-], URL)

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Per Encoding Standard, the document charset should not be magic in the case of BOM-sniffed UTF-16.
(Assignee)

Comment 1

4 years ago
Created attachment 830200 [details] [diff] [review]
Stop reporting UTF-16 without LE/BE

The binary patch changes "UTF-16" into "UTF-16BE" as an assertion expectation in a UTF-16BE file.
Attachment #830200 - Flags: review?(VYV03354)
Comment on attachment 830200 [details] [diff] [review]
Stop reporting UTF-16 without LE/BE

Review of attachment 830200 [details] [diff] [review]:
-----------------------------------------------------------------

::: docshell/test/browser/browser_bug234628-5.js
@@ +31,5 @@
>    is(gBrowser.contentDocument.documentElement.textContent.indexOf('\u0402'), 146, "Parent doc should decode as windows-1251 subsequently");
>    is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.documentElement.textContent.indexOf('\u20AC'), 87, "Child doc should decode as utf-16 subsequently");  
>  
>    is(gBrowser.contentDocument.characterSet, "windows-1251", "Parent doc should report windows-1251 subsequently");
> +  is(gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument.characterSet, "UTF-16LE", "Child doc should report UTF-16 subsequently");

"Child doc should report UTF-16LE subsequently"
Attachment #830200 - Flags: review?(VYV03354) → review+
(Assignee)

Comment 3

4 years ago
(In reply to Masatoshi Kimura [:emk] from comment #2)
> "Child doc should report UTF-16LE subsequently"

Thanks. Landed with this fixed.
https://hg.mozilla.org/integration/mozilla-inbound/rev/5c028db562c5
https://hg.mozilla.org/mozilla-central/rev/5c028db562c5
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28

Updated

4 years ago
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.