Closed
Bug 36440
Opened 26 years ago
Closed 26 years ago
JPN chars in an address book card are printed out as dots.
Categories
(MailNews Core :: Internationalization, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
M16
People
(Reporter: ji, Assigned: chuang)
Details
Build: 2000-04-19-09 commercial
Now we can print out address book card, but Japanese characters in an
address book card are printed out as dots.
Steps of reproduce:
1. Launch Address Book.
2. Create a card with Japanese firstname and lastname.
3. Select File | Print Card View...
The Japanese firstname and lastname are displayed as dots in the print preview
window and those Japanese chars are actually printed out as dots as well.
Comment 1•26 years ago
|
||
Reassign to chuang. Let us know if you need test cases.
Assignee: nhotta → chuang
Comment 3•26 years ago
|
||
http://lxr.mozilla.org/seamonkey/source/mailnews/addrbook/src/nsAddbookProtocolH
andler.cpp#428
420 // Ok, this is the place where we need to generate output for either a
single entry
421 // or the entire table...
422 //
423 if (mAddbookOperation == nsIAddbookUrlOperation::PrintIndividual)
424 rv = BuildSingleHTML(aDatabase, directory, charEmail, workBuffer);
425 else
426 rv = BuildAllHTML(aDatabase, directory, workBuffer);
427
428 *outBuf = workBuffer.ToNewCString();
429
430 EarlyExit:
431 // Database is open...make sure to close it
This problem is line 428. We should change this line to the following...
*outBuf = workBuffer.ToNewUTF8String();
On my Windows 2000 box, it works fine by this change.
Comment 4•26 years ago
|
||
He is right, I get assertions at ToNewCString when printing Japanese cards.
Rich, could you review?
Index: nsAddbookProtocolHandler.cpp
===================================================================
RCS file: /cvsroot/mozilla/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp,v
retrieving revision 1.5
diff -c -r1.5 nsAddbookProtocolHandler.cpp
*** nsAddbookProtocolHandler.cpp 2000/03/31 02:21:37 1.5
--- nsAddbookProtocolHandler.cpp 2000/04/21 16:22:56
***************
*** 425,431 ****
else
rv = BuildAllHTML(aDatabase, directory, workBuffer);
! *outBuf = workBuffer.ToNewCString();
EarlyExit:
// Database is open...make sure to close it
--- 425,431 ----
else
rv = BuildAllHTML(aDatabase, directory, workBuffer);
! *outBuf = workBuffer.ToNewUTF8String();
EarlyExit:
// Database is open...make sure to close it
Rich is not available today. The patch looks fine to me. I assume it works for
English too. Can you also try on an address book with Japanese address book
name? I want to know if it's working. Thanks.
Comment 6•26 years ago
|
||
I tried with Japanese addressbook name. It printed out fine but got an assertion
at following line of nsAbCardProperty.cpp.
1281 char *dirCharStr = dirNameStr.ToNewCString();
It is expected that the addressbook name to be printed somewere?
When I pass the address book print url (which contains the address book name) to
Rich's print engine, I just wonder if the way I did is ok for double byte
character. If the assertion is not serious, then I guess the url is passed
correctly.
Comment 8•26 years ago
|
||
You can use this for encoding URI (use "UTF-8" for charset) instead of
ToNewCString.
string nsITextToSubURI::ConvertAndEscape(in string charset, in wstring text);
Then other side to call decoding function.
wstring UnEscapeAndConvert(in string charset, in string text);
Anyway, can I check in the patch for nsAddbookProtocolHandler.cpp?
Yes, go ahead to check it in. Please mark it fixed after you check in. Thanks.
Comment 10•26 years ago
|
||
Checked in the fix, thank you for the contribution.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Target Milestone: --- → M16
| Reporter | ||
Comment 12•26 years ago
|
||
Verified as fixed with 2000042709 win32 commercial build.
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•