Closed Bug 1034724 Opened 10 years ago Closed 9 years ago

About:support page doesn't show correct non-ANSI names of fonts

Categories

(Toolkit :: General, defect)

18 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Iteration:
41.1 - May 25
Tracking Status
firefox30 --- wontfix
firefox31 - wontfix
firefox32 - affected
firefox33 - affected
firefox41 --- fixed
firefox-esr24 --- affected

People

(Reporter: fireattack, Assigned: jsnajdr, Mentored)

References

Details

(Keywords: regression, Whiteboard: [good first bug][lang=js])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140703154127

Steps to reproduce:

First I think you need a non-English OS to make the font name(s) non-English. In my case, I'm using Simp. Chinese Win7 x64.

It's easy to reproduce: just change one font setting to a some fonts like "微软雅黑"

In about:support, it will show as mojibake like:
font.name.sans-serif.zh-CN	微软éé»

In about:config page, this setting is shown as normal.

In extension part of about:support page, the string could be Chinese or Japanese without any problem.
#1 Regression window(m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/dab1d80a04f4
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120918124356
Bad:(empty):
http://hg.mozilla.org/integration/mozilla-inbound/rev/35b2c35d3243
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120918140057
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=dab1d80a04f4&tochange=35b2c35d3243

#2 Regression window(m-i)
Bad:(empty):
http://hg.mozilla.org/integration/mozilla-inbound/rev/5f3887536eef
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120918145357
Bad:(moji bake):
http://hg.mozilla.org/integration/mozilla-inbound/rev/be731f9147dc
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120918155756
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=5f3887536eef&tochange=be731f9147dc

Regressed by: Bug 554174
Blocks: 554174
Status: UNCONFIRMED → NEW
Component: Untriaged → General
Ever confirmed: true
Keywords: regression
Product: Firefox → Toolkit
Version: unspecified → 18 Branch
OR bug 789674
Blocks: 789674
Flags: needinfo?(jgriffin)
Keywords: qawanted
Flags: needinfo?(jgriffin)
Not tracking. Has been in Firefox for a while and we won't block the release for this.
I'm not sure why qawanted was added to this bug since this bug has been confirmed and has a regression window. Benjamin, please ensure you always provide details when setting qawanted. We're not great mind readers.
Keywords: qawanted
TroubleShoot.jsm uses a getPref helper to retrieve strings:
http://hg.mozilla.org/mozilla-central/annotate/668ade60cde9/toolkit/modules/Troubleshoot.jsm#l214

It uses getCharPref(name).

The old about:support (prior to bug 789674) used a getPrefValue helper:
https://hg.mozilla.org/mozilla-central/rev/83925e071235#l1.656

It uses getComplexValue(aName, Ci.nsISupportsString), which is better.

So we should just fix Troubleshoot.jsm to use getComplexValue.

(At the same time, we should eliminate the two copies of the "getPref" helper in Troubleshoot.jsm, per bug 804430 comment 18.)
Mentor: adw
Flags: firefox-backlog+
OS: Windows 7 → All
Hardware: x86_64 → All
Whiteboard: [good first bug][lang=js]
Fixed the Troubleshoot.jsm module:
- use getComplexValue to get the Unicode string. getCharPref returns UTF-8 encoded value, would need to be decoded first before usable
- refactored the modifiedPreferences and lockedPreferences methods to remove code duplication
- added a new test to browser_Troubleshoot.js to test proper Unicode handling
Attachment #8608058 - Flags: review?(adw)
Comment on attachment 8608058 [details] [diff] [review]
Fixed Unicode values of prefs in about:support

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

Very nice, thanks!  I verified it locally and it works as advertised.

https://hg.mozilla.org/integration/fx-team/rev/bfe02e08726e
Attachment #8608058 - Flags: review?(adw) → review+
Assignee: nobody → jsnajdr
Status: NEW → ASSIGNED
Thanks Drew! What do I need to do next? Push to try? Set checkin-needed?
https://hg.mozilla.org/mozilla-central/rev/bfe02e08726e
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Jarda, sorry for not explaining.  It's already checked in.  I pushed your patch directly to our fx-team repo, which is where we do Firefox front-end development and which is what the link in comment 7 points to.  Then your patch was merged to mozilla-central, as noted in comment 9, which is the repo that Firefox Nightly is built from.  I just tested in the latest Nightly, and it looks like your fix didn't make it in time, so it should be in the next Nightly.
Flags: needinfo?(adw)
Iteration: --- → 41.1 - May 25
Flags: qe-verify?
Thank you for an explanation Drew. The fix is right there today, in the 2015-05-22 Nightly.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: