Closed Bug 1645307 Opened 4 years ago Closed 4 years ago

Prepare for m-c removal of the intl.charset.detector.ng.enabled pref

Categories

(MailNews Core :: MIME, task, P1)

Tracking

(thunderbird78 unaffected)

RESOLVED FIXED
Thunderbird 79.0
Tracking Status
thunderbird78 --- unaffected

People

(Reporter: hsivonen, Assigned: mkmelin)

References

Details

Attachments

(1 file, 1 obsolete file)

Bug 1603712 will remove the intl.charset.detector.ng.enabled pref by making it unconditionally true. c-c will likely need minor corresponding clean-up.

Severity: -- → S1
Priority: -- → P1

A couple of notes:

  • Using FallbackCharset to match the Windows system "ANSI" code page was wrong and only worked if the Thunderbird and Windows localizations matched. It would probably be better to ask Windows for the "ANSI" code page and then either use Window's system conversion facility or use the mapping from https://github.com/hsivonen/charset
  • The detector part in MsgDetectCharsetFromFile always returns some encoding name, so it's not necessary to have a fallback in the callers.

It looks like we should just drop the system charset concept and do detection on the file instead. There are really few callers.

Off-topic: https://github.com/hsivonen/charset provides UTF-7 support, however, TB has its own here:
https://searchfox.org/comm-central/search?q=&path=utf7&case=false&regexp=false
So what's the story with this library?

Attached patch bug1645307_rm_charset_ng.patch (obsolete) (deleted) — Splinter Review

With this it builds, and the modified test succeeds.
I think there's more cleanup to be done, and as of now the encoding menu isn't being populated correctly.

I'm running out of time for now. Paul, can you have a look, and also see if you can get the menus going again?

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Attachment #9156959 - Flags: review?(paul)

(In reply to Henri Sivonen (:hsivonen) from comment #1)

use the mapping from https://github.com/hsivonen/charset

Oops. Sorry. I meant to link to https://github.com/hsivonen/codepage

(In reply to Jorg K (CEST = GMT+2) from comment #3)

Off-topic: https://github.com/hsivonen/charset provides UTF-7 support, however, TB has its own here:
https://searchfox.org/comm-central/search?q=&path=utf7&case=false&regexp=false
So what's the story with this library?

The library is a hobby project I wrote in Rust. It's not in Firefox, so in that sense it's not directly available to Thunderbird. Also, it doesn't do the IMAP stuff.

Will do, I'm working on this now.

The changes look good and worked for me when I built and tested it. This revision removes a couple more things. This lazy getter that was removed in the m-c patch:

diff --git a/mail/components/customizableui/CustomizableWidgets.jsm b/mail/components/customizableui/CustomizableWidgets.jsm
--- a/mail/components/customizableui/CustomizableWidgets.jsm
+++ b/mail/components/customizableui/CustomizableWidgets.jsm
 
-XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() {
-  const kCharsetBundle = "chrome://global/locale/charsetMenu.properties";
-  return Services.strings.createBundle(kCharsetBundle);
-});

And this panelview (used in m-c) that the previous revision had included, but isn't needed:

diff --git a/mail/components/customizableui/content/panelUI.inc.xhtml b/mail/components/customizableui/content/panelUI.inc.xhtml
--- a/mail/components/customizableui/content/panelUI.inc.xhtml
+++ b/mail/components/customizableui/content/panelUI.inc.xhtml

-    <panelview id="PanelUI-characterEncodingView" flex="1">
-      <vbox class="panel-subview-body">
-        <vbox id="PanelUI-characterEncodingView-pinned"
-              class="PanelUI-characterEncodingView-list"/>
-        <toolbarseparator/>
-        <vbox id="PanelUI-characterEncodingView-charsets"
-              class="PanelUI-characterEncodingView-list"/>
-      </vbox>
-    </panelview>

Following some discussion with mkmelin, I'm going to go ahead and land this to get us un-busted.

Attachment #9156959 - Attachment is obsolete: true
Attachment #9156959 - Flags: review?(paul)
Attachment #9157078 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 79.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: