Closed Bug 1565888 Opened 1 year ago Closed 1 year ago

Setting text encoding to "Japanese" in TB's source view gives: JavaScript error: chrome://messenger/content/viewSource.js, line 438: NS_ERROR_I LLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALU E) [nsIDocShell.charset]

Categories

(MailNews Core :: Internationalization, defect)

defect
Not set

Tracking

(thunderbird69 fixed, thunderbird70 fixed)

RESOLVED FIXED
Thunderbird 70.0
Tracking Status
thunderbird69 --- fixed
thunderbird70 --- fixed

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

It fails here
https://searchfox.org/comm-central/rev/e9439ba2501591b8d9890bd6973d74bd3c06da3f/common/src/viewSource.js#438
since "Japanese" is not a valid encoding.

Before I dig though the M-C code to see how they might have fixed similar cases, I'll ask Henri.

Flags: needinfo?(hsivonen)

Oh, looks like Henri is away for a while.

Flags: needinfo?(VYV03354)

Well, OK, so will that detect ISO-2022-JP and EUC-JP?

Attached patch 1565888-onSetCharacterSet.patch (obsolete) — Splinter Review

OK, this at least fixes the JS error. Masatoshi-san, please let me know whether the comment is correct and this triggers auto-detection.

Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Flags: needinfo?(hsivonen)
Attachment #9077992 - Flags: review?(VYV03354)

Hmm, I tried with a message in ISO-2022-JP and the source view changed from
[ESC]$B%F%9%H%F%9%H%F%9%H%F%9%H%F%9%H%F%9%H%F%9%H%F%9%H%F%9%H%F%9%H%F%9%H%F%9%H[ESC](B
to テストテストテストテストテストテストテストテストテストテストテストテスト so that appears to be working.

However, setting a message being composed to encoding "Japanese" seems to give

[4232, Main Thread] WARNING: 'NS_FAILED(rv)', file c:/mozilla-source/comm-central/editor/libeditor/TextEditor.cpp, line 215
*** Failed to get string japanese in bundle: chrome://communicator/content/labelsencodings.properties
JavaScript error: chrome://global/content/elements/stringbundle.js, line 45: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIStringBundle.GetStringFromName]

TextEditor.cpp, line 215 is EditorBase::SetDocumentCharacterSet(). So it looks like more work is required here, I'll file a new bug. The resulting message is stored in UTF-8 :-(

Filed bug 1565894 for the compose problem.

Fixed typo, sorry about the noise.

Attachment #9077992 - Attachment is obsolete: true
Attachment #9077992 - Flags: review?(VYV03354)
Attachment #9078011 - Flags: review?(VYV03354)

Masatoshi-san, can you please review this or should I find a different reviewer?

Comment on attachment 9078011 [details] [diff] [review]
1565888-onSetCharacterSet.patch

Henri can review this.
Attachment #9078011 - Flags: review?(VYV03354)
Comment on attachment 9078011 [details] [diff] [review]
1565888-onSetCharacterSet.patch

Review of attachment 9078011 [details] [diff] [review]:
-----------------------------------------------------------------

Looks alright to me. Same as https://searchfox.org/mozilla-central/rev/07f7390618692fa4f2a674a96b9b677df3a13450/browser/base/content/browser.js#7502
Attachment #9078011 - Flags: review+

Thanks, Magnus, I was just going to request it.

Target Milestone: --- → Thunderbird 70.0
Comment on attachment 9078011 [details] [diff] [review]
1565888-onSetCharacterSet.patch

TB 69 only (not TB 68 beta).
Attachment #9078011 - Flags: approval-comm-beta+

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/9f69adee0a1e
Replace Japanese with Shift_JIS in onSetCharacterSet() for view source. r=mkmelin DONTBUILD

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