Make mailnews not misuse the encoding reload code path
Categories
(MailNews Core :: Internationalization, task)
Tracking
(thunderbird_esr91 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr91 | --- | wontfix |
People
(Reporter: hsivonen, Assigned: rachel)
References
Details
Attachments
(1 file)
4.10 KB,
patch
|
darktrojan
:
review+
|
Details | Diff | Splinter Review |
Currently, nsMessenger::SetDisplayCharset
calls nsIContentViewer::SetReloadEncodingAndSource
.
Clearly, the mailnews isn't reloading anything here and is injecting an encoding using API surface that is intended for managing encoding detector-triggered renavigations on the Web.
Moreover, all three callers pass UTF-8, so it's pointless to support other encodings here.
Instead of misusing a mechanism intended for something else, I suggest either:
- Making the part of mailnews that generates the UTF-8 HTML representation to be fed to the HTML parser start with the UTF-8 BOM.
- Making the HTML parser itself detect mailnews-provided channels in the same place where
resource:
URLs are currently detected and forced to UTF-8.
Assignee | ||
Comment 1•2 years ago
|
||
As Henri pointed out, the use of setDisplayCharset("UTF-8")
is not required. Mailnews already follows suggestion 1 to prepend the UTF-8 BOM:
https://searchfox.org/comm-central/rev/a5e0b43873663e93584fc6e5de31ec9e9d115b02/mailnews/mime/emitters/nsMimeHtmlEmitter.cpp#314
So as far as we can see, a removal is all that's required. At least messages can be displayed again and bug 1745094 will likely be fixed.
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/e5077d2089c9
Remove needless nsIMessenger.setDisplayCharset(). r=darktrojan
Comment 3•2 years ago
|
||
We should also remove this rather confusing comment: https://hg.mozilla.org/comm-central/rev/e5077d2089c9#l2.47
Assignee | ||
Comment 4•2 years ago
|
||
Please do in a quick follow-up!
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/ae5adbac7f4a follow-up - remove obsolete confusing comment. rs=me
Description
•