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)

All
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

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.
Reassign to chuang. Let us know if you need test cases.
Assignee: nhotta → chuang
CC Rich for his attention
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.
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.
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.
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.
Checked in the fix, thank you for the contribution.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Target Milestone: --- → M16
ji, please verify this against a current build.
QA Contact: momoi → ji
Verified as fixed with 2000042709 win32 commercial build.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.