Open Bug 1803986 Opened 2 years ago Updated 9 months ago

Remove last remaining nsIScriptableUnicodeConverter usages across the Thunderbird codebase

Categories

(Thunderbird :: General, task)

Tracking

(thunderbird_esr115 wontfix)

ASSIGNED
120 Branch
Tracking Status
thunderbird_esr115 --- wontfix

People

(Reporter: darktrojan, Assigned: mkmelin)

References

(Blocks 1 open bug)

Details

(Keywords: leave-open)

Attachments

(4 files)

+++ This bug was initially created as a clone of Bug 1762335 +++

There's one last use of nsIScriptableUnicodeConverter, in EnigmailData. Most of the callers use UTF-8 as the charset, and can probably be replaced easily enough, but some don't. I don't know of another way to convert from an arbitrary charset at this point, so I'm leaving the function behind.

Blocks: 1762335
No longer depends on: 1762335

Use standard means to get bytestring from utf-8 data.

var {EnigmailData} = ChromeUtils.import("chrome://openpgp/content/modules/data.jsm");
var {MailStringUtils} = ChromeUtils.import("resource:///modules/MailStringUtils.jsm");
var text = "blä";
var A = EnigmailData.convertFromUnicode(text, "utf-8")
var B = MailStringUtils.stringToByteString(text);
A + " vs " + B;
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Attachment #9357244 - Attachment description: Bug 1803986 - Remove nsIScriptableUnicodeConverter usage from OpenPGP code. Part 1: UTF-8 to bytestring cases. r=#thunderbird-reviewers → Bug 1803986 - Remove nsIScriptableUnicodeConverter usage from OpenPGP code. Part 1: UTF-8 to bytestring cases. r=john.bieling
Target Milestone: --- → 120 Branch

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/234c7fb296c4
Remove nsIScriptableUnicodeConverter usage from OpenPGP code. Part 1: UTF-8 to bytestring cases. r=john.bieling

Remove some non-standard string conversions and unneeded conversion methods.

var {EnigmailData} = ChromeUtils.import("chrome://openpgp/content/modules/data.jsm");
var {MailStringUtils} = ChromeUtils.import("resource:///modules/MailStringUtils.jsm");
var text = "blä";
var A = EnigmailData.getUnicodeData(text)
var B = new TextDecoder("ISO-8859-1").decode(MailStringUtils.byteStringToUint8Array(text));
A + " vs " + B;

Attachment #9361263 - Attachment description: Bug 1803986 - Part 2: convert unconventional string conversions. r=#thunderbird-reviewers → Bug 1803986 - Part 2: convert unconventional string conversions. r=kaie

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/228762f3ba68
Part 2: convert unconventional string conversions. r=kaie
https://hg.mozilla.org/comm-central/rev/ea487393c15f
Part 3: Remove EnigmailData.convertToUnicode usages. r=kaie

Don't needlessly modify the decrypted data and try to de-code/re-code it later.

Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/ea5aa9daf42d Part 4 - remove some OpenPGP usage of homegrown mime parsing. r=kaie
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: