Closed Bug 1034724 Opened 9 years ago Closed 8 years ago

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


(Toolkit :: General, defect)

18 Branch
Not set



41.1 - May 25
Tracking Status
firefox30 --- wontfix
firefox31 - wontfix
firefox32 - affected
firefox33 - affected
firefox41 --- fixed
firefox-esr24 --- affected


(Reporter: human.peng, Assigned: jsnajdr, Mentored)



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


(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:	微软éé»

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)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120918124356
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120918140057

#2 Regression window(m-i)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120918145357
Bad:(moji bake):
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120918155756

Regressed by: Bug 554174
Blocks: 554174
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:

It uses getCharPref(name).

The old about:support (prior to bug 789674) used a getPrefValue helper:

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.
Attachment #8608058 - Flags: review?(adw) → review+
Assignee: nobody → jsnajdr
Thanks Drew! What do I need to do next? Push to try? Set checkin-needed?
Closed: 8 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.