Closed Bug 1417842 Opened 8 years ago Closed 8 years ago

non-ASCII content of xulstore.json corrupted after bug 1363482, was: Non-ASCII(?) chars in toolbar names are destroyed (and error is multiplied every TB start)

Categories

(Core :: General, defect)

57 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
thunderbird_esr52 --- unaffected
firefox-esr52 --- unaffected
firefox57 - wontfix
firefox58 - wontfix
firefox59 + fixed

People

(Reporter: jm_sz, Assigned: emk)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0 Build ID: 20171112125346 Steps to reproduce: I have updated TB 56.0b4 -> 57.0b1 (pl_PL) Actual results: Toolbar name changed from "Pasek narzędzi poczty 2" to "Pasek narzÃÂÃÂÃÂÃÂdzi poczty 2". Then I made simple test: 1. created toolbar and named it "Narzędzia" 2. closed and started TB 3. and again... 4. and again You may find that error in name is multiplied every time (see attachment: toolbar_names.jpg, corresponding parts) In addition: • Stable TB52 and previous betas (including TB56) are not affected. • Default TB toolbars are not affected ("Pasek narzędzi poczty", "Pasek panelu folderów" - see toolbar_names.jpg, part 2, yellow boxes) Expected results: Toolbar name should not change ;-)
I can confirm that. Add a toolbar with an accented character or some other non-ASCII character. Works. Restart TB and the name has mojibake in it. Alice, this could be from bug 1363281. Could you please find the regression. I'm sure a Japanese toolbar name will also not work.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(alice0775)
Keywords: regression
Blocks: 1363482
Thanks, Alice!! Kris, please advise what we can do here. In TB we can create new named toolbars, and non-ASCII names get corrupted. I can't see that feature in FF.
Flags: needinfo?(kmaglione+bmo)
xulstore.json file will be corrupted after restart and quit TB When add custom toolbar and quit TB "header-view-toolbox":{"labelalign":"end","iconsize":"small","mode":"icons"},"attachment-view-toolbar":{"iconsize":"small"},"msgHeaderViewDeck":{"selectedIndex":"0"},"statusbar-QLS":{"ccode":"ja-JP"},"folderPane-toolbar":{"currentset":"folderpane-mode-selector"},"customToolbars":{"toolbar1":"Narzędzia:button-goforward"}} After restart and quit TB "header-view-toolbox":{"labelalign":"end","iconsize":"small","mode":"icons"},"attachment-view-toolbar":{"iconsize":"small"},"msgHeaderViewDeck":{"selectedIndex":"0"},"statusbar-QLS":{"ccode":"ja-JP"},"folderPane-toolbar":{"currentset":"folderpane-mode-selector"},"customToolbars":{"toolbar1":"NarzÄdzia:button-goforward"}}
Component: Toolbars and Tabs → General
Product: Thunderbird → Core
Summary: Non-ASCII(?) chars in toolbar names are destroyed (and error is multiplied every TB start) → non-ASCII content of xulstore.json corrupted after bug 1363482, was: Non-ASCII(?) chars in toolbar names are destroyed (and error is multiplied every TB start)
See Also: → 1418325
Is this still broken after bug 1420427 is fixed?
Yes. We need to change Cu.readFile to return an AString rather than an ACString. XPC apparently doesn't handle UTF-8 correctly when converting CStrings.
Flags: needinfo?(kmaglione+bmo)
(In reply to Kris Maglione [:kmag] (long backlog; ping on IRC if you're blocked) from comment #6) > Yes. We need to change Cu.readFile to return an AString rather than an > ACString. XPC apparently doesn't handle UTF-8 correctly when converting > CStrings. What encoding will be used to convert the file content to nsString (i.e. UTF-16)? What happens if the file is a binary? Cu.readFile should return ArrayBuffer or it should be changed to Cu.readJSON.
Or AUTF8String readUTF8File(in nsIFile file); .
[Tracking Requested - why for this release]: regression in 57 causing dataloss. The steps to reproduce given here only involve Thunderbird; if there's no way to reproduce on Firefox it probably doesn't matter much for 57/58, but we should really fix for 59 (the next esr branch that Thunderbird will be releasing from).
Attachment #8933255 - Flags: review?(erahm)
Comment on attachment 8933255 [details] Bug 1417842 - Make Cu.readFile and Cu.readURI UTF-8 aware. https://reviewboard.mozilla.org/r/204194/#review212598 Seems reasonable, r=me.
Attachment #8933255 - Flags: review?(erahm) → review+
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/autoland/rev/e6479b173009 Make Cu.readFile and Cu.readURI UTF-8 aware. r=erahm
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Please request Beta approval on this when you get a chance.
Assignee: nobody → VYV03354
Flags: needinfo?(VYV03354)
Comment on attachment 8933255 [details] Bug 1417842 - Make Cu.readFile and Cu.readURI UTF-8 aware. Approval Request Comment [Feature/Bug causing the regression]: 1363482 [User impact if declined]: Potentially dataloss (especially in Thunderbird) [Is this code covered by automated tests?]: No [Has the fix been verified in Nightly?]: Yes [Needs manual test from QE? If yes, steps to reproduce]: No known regressions in Firefox. Thunderbird QE (if exists) should verify the fix following the step in comment #0. [List of other uplifts needed for the feature/fix]: None [Is the change risky?]: No [Why is the change risky/not risky?]: Changed functions are used only for decoding JSON files which are encoded in UTF-8. [String changes made/needed]: None
Flags: needinfo?(VYV03354)
Attachment #8933255 - Flags: approval-mozilla-beta?
Comment on attachment 8933255 [details] Bug 1417842 - Make Cu.readFile and Cu.readURI UTF-8 aware. From comment #10, the issue is not reproduced in FF and the next esr branch that Thunderbird will be releasing from is 59/60. Beta58-.
Attachment #8933255 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: