Closed Bug 1297118 Opened 8 years ago Closed 5 years ago

Inspect use of charset names in MIME/compose to make sure Gecko-canonical names are used where required

Categories

(MailNews Core :: MIME, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 65.0

People

(Reporter: jorgk-bmo, Unassigned)

Details

This started from bug 1191841 where calling SetForceCharacterSet() not using a Geck-canonical name led to crash.

In attachment 8783355 [details] [diff] [review] a local change was suggested, but Henri's feedback called for a better approach.

We need to inspect the use of the charset extracted from the MIME headers:
https://dxr.mozilla.org/comm-central/search?q=m_compFields-%3EGetCharacterSet&redirect=false

In any case, we need to call SetForceCharacterSet() with the Gecko-canonical name as indicated by the patch or earlier on:
https://dxr.mozilla.org/comm-central/rev/02115be839cfcd0ba3b44f7fe480974496f0a86d/mailnews/compose/src/nsMsgCompose.cpp#1606
Actually, in bug 1191841 nsDocumentViewer::SetForceCharacterSet() is changed to accept labels and not only Gecko-canonical names. So we have no immediate need for action.
(In reply to Jorg K (GMT+2, PTO during summer) from comment #1)
> So we have no immediate need for action.

It's worthwhile to check if viewing and replying to UTF-7 emails still works.
(In reply to Henri Sivonen (:hsivonen) from comment #2)
> It's worthwhile to check if viewing and replying to UTF-7 emails still works.
Thanks for the hint. We got a test failure for "x-mac-croatian" in bug 1297761.
(In reply to Jorg K (GMT+2, PTO during summer) from comment #3)
> (In reply to Henri Sivonen (:hsivonen) from comment #2)
> > It's worthwhile to check if viewing and replying to UTF-7 emails still works.
> Thanks for the hint. We got a test failure for "x-mac-croatian" in bug
> 1297761.

That test failure also has an instance of EXCEPTION: a != b: 'UTF-8' != 'windows-1252'.
(In reply to aleth [:aleth] from comment #4)
> That test failure also has an instance of EXCEPTION: a != b: 'UTF-8' !=
> 'windows-1252'.
Yes, but that's no longer there if we restore the status quo in bug 1297761.
(In reply to Henri Sivonen (:hsivonen) from comment #2)
> It's worthwhile to check if viewing and replying to UTF-7 emails still works.
As per bug 1297761 comment #7, replying to UTF-7 is currently broken (but fixable with a quick hack before we address it in this bug here).
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/4ec85e9cf4a0
Remove comment referring to bug 1297118. rs=comment-only DONTBUILD
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Fixed by switching to encoding_rs, bug 1363281, the UTF-7 follow up, bug 1402813 and finally retrieving canonical name in a few more call sites, including JS Mime, in bug 1511950.

Our call to SetForceCharacterSet()
https://searchfox.org/comm-central/rev/6ff0a001e73986bb4a273a1aa7db5fb2752ec017/mailnews/compose/src/nsMsgCompose.cpp#1661
is preceded by a call to fixCharset() which gets a canonical name.

No further action required here.
Target Milestone: --- → Thunderbird 65.0
You need to log in before you can comment on or make changes to this bug.