Closed Bug 61100 Opened 24 years ago Closed 24 years ago

Cannot import non-Latin1 folder name in Outlook Express

Categories

(MailNews Core :: Internationalization, defect, P3)

x86
Windows 2000

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: m_kato, Assigned: m_kato)

Details

(Keywords: intl)

Attachments

(4 files)

releted to bug 58897.  But this problem is other.
I think that this bug is very very critical for Japanese User.  Hotta-san, I 
hanve fix code.  please review...

REPRO STEP
==========
1. Run Mozilla mail
2. select Import
3. select Outlook Express
4. select [ok] and [next]
Attached patch fix code for OESplinter Review
Summary: Cannot inport non-Latin1 folder name in Outlook Express → Cannot import non-Latin1 folder name in Outlook Express
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reassign to Kato san.
Assignee: nhotta → m_kato
My comments for the patch.
* Please use nsICharsetConverterManager2 instead of nsICharsetConverterManager.
* Please check the return value of SystemStringFromUnicode in ConvertToUnicode.
* Release the encoder in nsImportService destructor.
Let me know when you post new patches with Naoki's changes and I'll look at
super reviewing that patch. Thanks!
Status: NEW → ASSIGNED
Couple comments,
in nsMsgFolder we should be using a nsXPIDLString for the variable: folderName.
Can you change that:
PRUnichar *folderName = nsnull;
should be
nsXPDILString folderName.

Then you can get rid of the two nsMemory::Free(folderName) calls that you had to
add.

I didn't understand the comment in this line:
if (!gService || NS_FAILED(rv)) // XXX bad cast
what was the bad cast? I don't see anything that looked strange.

Everyting else looks good to me.
In the patch (11/29), there are still no return value checks for
SystemStringToUnicode() and SystemStringFromUnicode() in nsImportMail.cpp.
Please added those checks.

About Scott's comment, that's a fallback when charset conversion not available.
It could be a bad cast for non Latin1 but it's okay for Latin1. So you may want
to add more words in the comment or change to "fallback to Latin1".

mscott, is this no problem by the following code??

nsMsgFolder.cpp
 :
 :
if(NS_SUCCEEDED(rv))
{
  nsXPIDLString folderName;
  rv = folder->GetName(getter_Copies(folderName));
  // case-insensitive compare is probably LCD across OS filesystems
  if (NS_SUCCEEDED(rv) && nsCRT::strcasecmp(folderName, uniName.GetUnicode()) 
== 0)
  {
    *aChild = folder;
    NS_ADDREF(*aChild);
    return NS_OK;
  }
}

And nsString::AssignWithConversion occurs bad cast when string is no-latin1 
string.  These codes uses in many parts (mailnews, widget etc)
Thanks for making the change to use nsXPIDLString. These changes look good to
me. sr=mscott. I think you still need a final r= from Naoki though. 
Where is the new patch (after 11/29)?
I need to see the patch in order to review.
Attached patch new patchesSplinter Review
I already send via mail (Date: Thu, 07 Dec 2000 02:13:43 +0900).
But I attach this bug.  Hotta-san, please review
As I mentioned before, return value checks are needed for
SystemStringToUnicode() and SystemStringFromUnicode() in nsImportMail.cpp.

I don't think I recived the patch by e-mail. Anyway, it's good to attach the
patch to bug report. See the mozilla code review page for detail.
http://www.mozilla.org/hacking/reviewers.html

I put r=nhotta to reduce an extra review process, please include the error check
before you check in.
Keywords: intl
check in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
** Checked with 1/7/2001 Win32 build **

Th original problem reported was the following:

1. Have Japanese or other non-Latin 1 Outlook Express with
   mail folders names using non-Latin 1 folder names, e.g. Japanese.
2. Start Mozilla Mail and engage File | Import menu and choose Mail.
3. From the selection window, choose Outlook Express and start importing.
4. It seems to import the folders but when you look at the imported 
   folder names, the ones with non-Latin 1 names are unreadable.
5. When you re-start Mozilla, the unreadable folder names are gone.
6. Therefore it seems what you see in step 5 is just a temporary situation.
   The folders seem to be there but not really and they disappear 
   upon re-starting. 

With the above new build, not only the import succeeds but we can also
read the Japanese or non-ASCII names and they stay in the 
imported account after a re-start. 

Marking the fix as verified as fixed.
Status: RESOLVED → VERIFIED
CC'ing IQA people. 
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: