Open Bug 197271 Opened 17 years ago Updated Last year

Intl printer name(e.g., Japanese name) is displayed as garbage in about:config

Categories

(Core :: Internationalization, defect, P3)

x86
Windows 2000
defect

Tracking

()

Future

People

(Reporter: kazhik, Unassigned)

Details

(Keywords: intl)

Attachments

(2 obsolete files)

Japanese printer name is displayed as garbage in about:config.

Screenshot:
http://bugzilla.mozilla.gr.jp/attachment.cgi?id=1530&action=view

Original report in Bugzilla-jp:
http://bugzilla.mozilla.gr.jp/show_bug.cgi?id=3020

Related bug: bug 107418
Reproduced with 2003031108-trunk/WinXP.
Now we use printe name of OS's that maybe include non-ascii code for prefernce
name of printer
and our preferences name now cannot include non-ascii code.
All arguments of methods for interfaces of prefs use 'char' for preference name.
I think that there are two approach.
1st: In prefs, we move printer name to value.
2nd: we add method for unicode preference name.

I hope that someone add 'intl' to keywords.
Product: Browser → Seamonkey
same Fx.
Component: Preferences → Preferences: Backend
Product: Mozilla Application Suite → Core
taking.
Assignee: bugs → masayuki
Component: Preferences: Backend → Internationalization
Keywords: intl
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta3
Attached patch fix for file handling (obsolete) — Splinter Review
This patch will fix to save to prefs.js only.
It will not fix view of about:config.
Attachment #184768 - Flags: review?(jshin1987)
about:config problem:

http://lxr.mozilla.org/seamonkey/source/toolkit/components/viewconfig/content/config.js#260
260 function prefObject(prefName, prefIndex)
261 {
262   this.prefCol = prefName;
263 }

There is UTF-8 string in prefName.
We need to convert UTF-8 to UCS2.
But I don't know how to convert in Javascript.
Status: NEW → ASSIGNED
Comment on attachment 184768 [details] [diff] [review]
fix for file handling

We really have to go through the tree to examine every use of 'WithCoversion'
and 'NS_ConvertUnicodeToASCII'.
Attachment #184768 - Flags: review?(jshin1987) → review+
I think that we need to implement nsIUTF8ConverterService::ConvertStringFromUTF8.
Oh, convertStringToUTF8 is converting native code(string) to UTF-8. Therefore,
convertStringFromUTF8 should be UTF-8 to native code conveter.
But I need UTF-8 to wstring converter...

Jungshik, can you implement it?
Comment on attachment 184768 [details] [diff] [review]
fix for file handling

Is there a reason not to be using AppendUTF16toUTF8() here instead of messing
around with this temporary variable?
Oh, I didn't know such function...
I re-create the patch. Please wait.
Attachment #184768 - Flags: superreview?(bzbarsky) → superreview-
Attached patch fix for file handling2 (obsolete) — Splinter Review
Attachment #184768 - Attachment is obsolete: true
Attachment #184813 - Flags: superreview?(bzbarsky)
Attachment #184813 - Flags: review?(jshin1987)
Comment on attachment 184813 [details] [diff] [review]
fix for file handling2

Carrying over jshin's r=, and sr=bzbarsky
Attachment #184813 - Flags: superreview?(bzbarsky)
Attachment #184813 - Flags: superreview+
Attachment #184813 - Flags: review?(jshin1987)
Attachment #184813 - Flags: review+
QA Contact: bugzilla → nobody
Comment on attachment 184813 [details] [diff] [review]
fix for file handling2

a=shaver
Attachment #184813 - Flags: approval1.8b3? → approval1.8b3+
checked-in.
But we have about:config rendering problem.
I thought we only supported ASCII pref names... (and that the rest worked sorta
by accident)...
(http://lxr.mozilla.org/seamonkey/source/modules/libpref/public/nsIPrefBranch.idl
uses string as the data type, which is ASCII only)
A design of nsIPrefBranch is very bad.
Because it uses string (not wstring) for each parameter of pref names.
But, we are using UTF-8 in pref.js. So we can use unicode by char*.
I think we can solve this problem...
# But I don't know how to solve it.
I created the function that converts UTF-8 to UTF-16.
And I inserted the process to here.
http://lxr.mozilla.org/seamonkey/source/toolkit/components/viewconfig/content/config.js#262
260 function prefObject(prefName, prefIndex)
261 {
262   this.prefCol = prefName;
263 }

But it doesn't work fine...
Summary: Japanese printer name is displayed as garbage in about:config → Intl printer name(e.g., Japanese name) is displayed as garbage in about:config
Target Milestone: mozilla1.8beta3 → Future
>A design of nsIPrefBranch is very bad.
>Because it uses string (not wstring) for each parameter of pref names.

well, it just does not allow non-ASCII pref names. that does not seem like a bad
design in itself. it seems to me like the printing code is broken for setting
prefs with non-ASCII names.

(non-ASCII values are supported via getComplexPref/nsISupportsString)


in theory you could, from JS, use nsIScriptableUnicodeConverter to convert the
name from UTF-8, but that sucks.
Assignee: masayuki → nobody
Status: ASSIGNED → NEW
QA Contact: nobody → masayuki
QA Contact: masayuki → i18n
Moving to p3 because no activity for at least 1 year(s).
See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.