Unicode UTF-8 HTML attachments are being distorted
Categories
(bugzilla.mozilla.org :: General, defect)
Tracking
()
People
(Reporter: 5i13ghzt462u, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0
Steps to reproduce:
I filled bug 1714632 by attaching the following HTML file: https://gist.github.com/rugk/71cadef3b8a8f18909c4f3f4e649121e
Actual results:
The emojis are distorted: https://bug1714632.bmoattachments.org/attachment.cgi?id=9225265
Expected results:
Leave my file as it is. Otherwise it makes it hard to attach test cases, which rely on this/make them not reproducible etc.
This is happening because the file is being left as is.
As that attachment doesn't specify that it's using the UTF-8 charset it's rendered as provided a default encoding is used, resulting in the emojibake you see. For me with Firefox the encoding used is windows-1252
.
You can fix this in Firefox when viewing the attachment via View --> Repair Text Encoding
.
If you want your HTML displayed as UTF-8 you'll need to set the charset with <meta charset="UTF-8">
in your document; I'll attach an example to this bug.
Description
•