Closed
Bug 393119
Opened 17 years ago
Closed 14 years ago
XPConnect's Dump doesn't do string conversions correctly
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: hello, Assigned: hello)
References
(Depends on 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
1.05 KB,
patch
|
mrbkap
:
review+
mrbkap
:
superreview+
|
Details | Diff | Splinter Review |
753 bytes,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
It breaks on UTF-16 strings, because it gets bytes instead of chars, and just prints them directly. The attached patch solves the problem. Test case: I have an ini file like: [foo] cheese=チーズが好きですか。 And some code like this (iniFile is an nsILocalFile): var ini = Cc["@mozilla.org/xpcom/ini-parser-factory;1"]. getService(Ci.nsIINIParserFactory).createINIParser(iniFile); var cheese = ini.getString("foo", "cheese"); dump(cheese + "\n"); And I see garbage on the terminal (using OS X's Terminal.app).
I think we want to make XPConnect's dump assume the console is UTF-8 (that is, take this patch) since: 1) it matches what window.dump does in chrome, and it's confusing to have those behave differently. 2) I think most modern consoles are UTF-8 (Mac OS X, most modern Linux distros), and if they're not, you're probably not going to be able to usefully print most non-ASCII stuff anyway. You should request r+sr from jst, I think.
Assignee | ||
Updated•17 years ago
|
Attachment #277632 -
Flags: superreview?(jst)
Attachment #277632 -
Flags: review?(jst)
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → thunder
Updated•17 years ago
|
Attachment #277632 -
Flags: superreview?(jst)
Attachment #277632 -
Flags: superreview+
Attachment #277632 -
Flags: review?(jst)
Attachment #277632 -
Flags: review+
Assignee | ||
Comment 2•14 years ago
|
||
This bug just hit mhanson. I no longer have a mozilla tree set up, if any of you wouldn't mind checking that the patch still applies and commit it, I'll owe you a hug. Or a beer. Up to you.
Comment 3•14 years ago
|
||
The patch didn't apply... so I updated it.
Attachment #277632 -
Attachment is obsolete: true
Attachment #434082 -
Flags: superreview+
Attachment #434082 -
Flags: review+
Comment 4•14 years ago
|
||
The tree is metered right now so I can't check in. But hopefully someone will come along and check the updated patch in.
Keywords: checkin-needed
Assignee | ||
Comment 5•14 years ago
|
||
Yay! Hugs for mrbkap!
Comment 6•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/3a91d9ba7f22
Comment 7•14 years ago
|
||
This patch broke mingw compilation where wchar_t != unsigned short. The attached patch fixes the problem.
Updated•14 years ago
|
Attachment #435135 -
Flags: review?(mrbkap)
Updated•14 years ago
|
Attachment #435135 -
Flags: review?(mrbkap) → review+
Comment 8•14 years ago
|
||
Comment on attachment 435135 [details] [diff] [review] mingw fix Ick.
Updated•14 years ago
|
Keywords: checkin-needed
Comment 9•14 years ago
|
||
Reopening... I'm not sure if our checkin-needed fairies check FIXED bugs.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
http://hg.mozilla.org/mozilla-central/rev/7019e5fc3ede
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•