Closed Bug 1746695 Opened 3 years ago Closed 3 years ago

Improve method and variable names related to charset detection, fix comments, fix passing detected charset to the UI

Categories

(MailNews Core :: Internationalization, defect)

defect

Tracking

(thunderbird_esr91 wontfix)

RESOLVED FIXED
97 Branch
Tracking Status
thunderbird_esr91 --- wontfix

People

(Reporter: rachel, Assigned: rachel)

Details

Attachments

(3 files, 3 obsolete files)

+++ This bug was initially created as a clone of Bug #1713786 +++

In bug 1713786 manually setting a charset was replaced with charset detection. We feel that the method and variable names should be improved in this area. Also, there are still some comments referring to the "folder charset" that was removed in bug 1671880 part 2.

Previously, it was all about overriding the message charset. Now it is about first auto-detecting a suitable message charset and then overriding the message charset with the auto-detected one. Overriding uses a flag and a charset, auto-detection just uses a flag. We hope that our patch clarifies the concepts.

In a second part we fix a bug that causes the detected charset not being reflected in msgWindow.mailCharacterSet as can be seen with the CharsetMenu add-on.

No functional change here, just renaming methods and variables and fixing comments.

Attachment #9255990 - Attachment is patch: true

s/CharSet/Charset/ for consistent spelling.

Attachment #9255990 - Attachment is obsolete: true
Attachment #9255991 - Flags: review?(mkmelin+mozilla)

Test message for Part 2. The message has no charset, but is displayed correctly. However, dumping out msgWindow.mailCharacterSet in the console shows UTF-8, which is not correct.

You can use console.log(msgWindow.mailCharacterSet) to check the patch. It will now display KOI8-U which is the detected charset.

Note that the subject isn't displayed correctly, that's bug 1739609.

Attachment #9255994 - Flags: review?(mkmelin+mozilla)

(In reply to Rachel Martin from comment #4)

Note that the subject isn't displayed correctly, that's bug 1739609.

More precisely: The subject is also in KOI8-U, so of course it's not displayed correctly. Bug 1739609 should likely fix that.

Added a test.

Attachment #9255994 - Attachment is obsolete: true
Attachment #9255994 - Flags: review?(mkmelin+mozilla)
Attachment #9256088 - Flags: review?(mkmelin+mozilla)

There was potential to improve the existing test.

Attachment #9256088 - Attachment is obsolete: true
Attachment #9256088 - Flags: review?(mkmelin+mozilla)
Attachment #9256091 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9255991 [details] [diff] [review] Part 1: 1746695-charset-detect.patch Review of attachment 9255991 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me. r=mkmelin
Attachment #9255991 - Flags: review?(mkmelin+mozilla) → review+
Attachment #9256091 - Flags: review?(mkmelin+mozilla) → review+

Thank you.

Assignee: nobody → rachel
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → 97 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/778b87646604
Improve method and variable names related to charset detection. r=mkmelin
https://hg.mozilla.org/comm-central/rev/00ae85f77818
Fix communication of charset back to window. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: