Closed Bug 270580 Opened 20 years ago Closed 20 years ago

Cannot print if first printing trigger is javascript(window.print()) with a printer with non-Latin1 (e.g. Japanese) characters in its name

Categories

(Core :: Printing: Output, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: masayuki, Assigned: jshin1987)

References

()

Details

(Keywords: fixed1.7.6, intl)

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041117
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041117

On Win9x, if first printing is called by javascript(window.print()),
common dialog cannot find the default printer.
But if the printer name is made by only latain1, this problem is not reproduced.

Reproducible: Always
Steps to Reproduce:
1. Include non-Latain1 character into default printer name.
2. Start the Mozilla.
3. Click the URL of this bug.

Actual Results:  
Printer is not found.

Expected Results:  
Common dialog is shown.
Assignee: core.printing → jshin
Keywords: intl
If Bug 270812 is fixed, this problem will not be reproduced.
But not fixed...
Attached patch Patch rv1.0 (obsolete) — Splinter Review
O.K. This patch will fix this bug!
Attachment #166548 - Flags: review?(jshin)
Comment on attachment 166548 [details] [diff] [review]
Patch rv1.0

>? gfx/src/windows/dependentLibs.h
>? gfx/src/windows/gkgfxwin.pdb
>Index: gfx/src/windows/nsDeviceContextSpecWin.cpp
>===================================================================

>+    nsCAutoString newNameNative(name);
>+    nsAutoString newName;
>+    NS_CopyNativeToUnicode(newNameNative, newName);

You can just do this:

nsAutoString newName;
NS_CopyNativeToUnicode(nsDependentCString(name), newName);
Attachment #166548 - Flags: review?(jshin)
Attached patch Patch rv1.1 (obsolete) — Splinter Review
Attachment #166548 - Attachment is obsolete: true
Attachment #166645 - Flags: review?(jshin)
Comment on attachment 166645 [details] [diff] [review]
Patch rv1.1

>     nsString newName; 
>-    newName.AssignWithConversion(name);
>+    NS_CopyNativeToUnicode(nsDependentCString(name), newName);

Gee, why did you go back to |nsString newName|? |nsAutoString newName| is
better than |nsString newName| because |newName| is shorter than 64 characters
in most cases. See http://www.mozilla.org/projects/xpcom/string-guide.html
Attachment #166645 - Flags: review?(jshin)
Attached patch Patch rv1.2Splinter Review
Attachment #166645 - Attachment is obsolete: true
Attachment #166672 - Flags: review?(jshin)
Comment on attachment 166672 [details] [diff] [review]
Patch rv1.2

r=jshin
Attachment #166672 - Flags: review?(jshin) → review+
Attachment #166672 - Flags: superreview?(bzbarsky)
Comment on attachment 166672 [details] [diff] [review]
Patch rv1.2

sr=bzbarsky
Attachment #166672 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 166672 [details] [diff] [review]
Patch rv1.2

The risk of this patch is low.
Attachment #166672 - Flags: approval1.8a5?
Attachment #166672 - Flags: approval1.7.x?
Attachment #166672 - Flags: approval-aviary?
Attachment #166672 - Flags: approval1.8a5?
Jungshik:

Please check-in to Trunk.
Attachment #166672 - Flags: approval1.7.6?
Flags: blocking1.7.6?
Flags: blocking1.7.5?
Flags: blocking-aviary1.0?
Comment on attachment 166672 [details] [diff] [review]
Patch rv1.2

1.0 has shipped and we're looking to the trunk for future Firefox releases.
Attachment #166672 - Flags: approval-aviary? → approval-aviary-
Flags: blocking-aviary1.0? → blocking-aviary1.0-
Comment on attachment 166672 [details] [diff] [review]
Patch rv1.2

1.7.5 has shipped. Moving request to 1.7.6.
Attachment #166672 - Flags: approval1.7.5?
1.7.5 has shipped. Moving request to 1.7.6.
Flags: blocking1.7.5?
Jungshik:

Please check-in the patch to Trunk.
sorry for the delay. fix checked in
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
not blocking 1.7.6 but we'd take the patch if in quickly. add fixed1.7.6 keyword
when checked-in.
Flags: blocking1.7.6? → blocking1.7.6-
Comment on attachment 166672 [details] [diff] [review]
Patch rv1.2

a=caillon (on behalf of drivers) for 1.7.6.  Please land this quickly.
Attachment #166672 - Flags: approval1.7.6? → approval1.7.6+
Keywords: fixed1.7.6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: