Closed Bug 443344 Opened 16 years ago Closed 16 years ago

attachment filename corruption imported from Eudora (Japanese version).

Categories

(Thunderbird :: Migration, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3

People

(Reporter: hiro, Assigned: hiro)

Details

(Keywords: fixed1.8.1.17)

Attachments

(2 files, 7 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080419 Ubuntu/8.04 (hardy) Firefox/2.0.0.14 Kazehakase/0.5.4
Build Identifier: 

Japanese filename (Shift-JIS encoded) gets corrupted.

ex.

2001テキスト.txt -> 2001

I think the filename should be converted.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Attached patch Proposed patch against cvs HEAD (obsolete) — Splinter Review
Just copy and paste code from nsOutlookMail.cpp.
Attached patch A patch for 1.8 branch (obsolete) — Splinter Review
IMO, the patch should be applied in 1.8 branch, since new comer from Eudora can not migrate to TB.
Your patch needs reviews. You can get that by setting the review? and superreview? flags on the patch. (And fill in a reviewer address, you can try bienvenu@nventure.com for for both review and superreview.)
Assignee: nobody → poincare
Attachment #327928 - Flags: superreview?(bienvenu)
Attachment #327928 - Flags: review?(bienvenu)
Attachment #328083 - Flags: superreview?(bienvenu)
Attachment #328083 - Flags: review?(bienvenu)
Magnus, thank you for your advices. I've set both of it.
Comment on attachment 328083 [details] [diff] [review]
A patch for 1.8 branch

I'd like a Eudora person to have a quick look as well...
Attachment #328083 - Flags: review?(bienvenu) → review?(beckley)
Comment on attachment 327928 [details] [diff] [review]
Proposed patch against cvs HEAD

This does look OK to me - at least, it's what we're doing in Outlook.
Attachment #327928 - Flags: superreview?(bienvenu)
Attachment #327928 - Flags: superreview+
Attachment #327928 - Flags: review?(bienvenu)
Attachment #327928 - Flags: review?(beckley)
Comment on attachment 328083 [details] [diff] [review]
A patch for 1.8 branch

It looks like there are tabs in this patch. Could you convert them to spaces? thx!
Attachment #328083 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 327928 [details] [diff] [review]
Proposed patch against cvs HEAD

Looks good from a Eudora standpoint.

One thing that would make this patch less risky would be to fall back on the old "aAttachmentName = name;" code if there is an error doing the new code, i.e. rv is not success.  With that, r=me.
Attachment #327928 - Flags: review?(beckley) → review+
Comment on attachment 328083 [details] [diff] [review]
A patch for 1.8 branch

My comment in the other patch applies here as well.
Attachment #328083 - Flags: review?(beckley) → review+
Attached patch Patch for cvs HEAD (obsolete) — Splinter Review
Fall back if the conversion is failed.
Attachment #327928 - Attachment is obsolete: true
Attachment #328276 - Flags: superreview?(beckley)
Attachment #328276 - Flags: review?(bienvenu)
Attached patch Patch for 1.8 branch (obsolete) — Splinter Review
Expandtab and fall back if the conversion is failed.

David and Jeff, thank you for your kindly response!
Attachment #328276 - Attachment is obsolete: true
Attachment #328277 - Flags: superreview?(beckley)
Attachment #328277 - Flags: review?(bienvenu)
Attachment #328276 - Flags: superreview?(beckley)
Attachment #328276 - Flags: review?(bienvenu)
Attachment #328276 - Attachment is obsolete: false
Attachment #328276 - Flags: superreview?(beckley)
Attachment #328276 - Flags: review?(bienvenu)
Attachment #328083 - Attachment is obsolete: true
Comment on attachment 328276 [details] [diff] [review]
Patch for cvs HEAD

Actually, doesn't this leak memory? ToNewUTF8String will return an allocated buffer, and then we're assigning it to a a CString, which will copy the buffer. I think you want to do something like aAttachmentName.Adopt(ToNewUTF8String(description));
Attached patch Patch for cvs HEAD (obsolete) — Splinter Review
Plug a memory leak.

David, thank you for your pointing out. I am not familiar with Gecko code.
Attachment #328277 - Attachment is obsolete: true
Attachment #328283 - Flags: superreview?(beckley)
Attachment #328283 - Flags: review?(bienvenu)
Attachment #328277 - Flags: superreview?(beckley)
Attachment #328277 - Flags: review?(bienvenu)
Attachment #328283 - Attachment description: Patch for 1.8 branch → Patch for cvs HEAD
Attached patch Patch for 1.8 branch (obsolete) — Splinter Review
Ditto.
Attachment #328276 - Attachment is obsolete: true
Attachment #328284 - Flags: superreview?(beckley)
Attachment #328284 - Flags: review?(bienvenu)
Attachment #328276 - Flags: superreview?(beckley)
Attachment #328276 - Flags: review?(bienvenu)
(In reply to comment #13)
> Created an attachment (id=328283) [details]
> Patch for 1.8 branch

I am sorry, the patch is not for 1.8 branch, it is for cvs HEAD.
Comment on attachment 328283 [details] [diff] [review]
Patch for cvs HEAD

Looks good now.  Bienvenu should be superreview.
Attachment #328283 - Flags: superreview?(bienvenu)
Attachment #328283 - Flags: superreview?(beckley)
Attachment #328283 - Flags: review?(bienvenu)
Attachment #328283 - Flags: review+
Comment on attachment 328284 [details] [diff] [review]
Patch for 1.8 branch

Looks good now.  Bienvenu should be superreview.
Attachment #328284 - Flags: superreview?(bienvenu)
Attachment #328284 - Flags: superreview?(beckley)
Attachment #328284 - Flags: review?(bienvenu)
Attachment #328284 - Flags: review+
Attached patch Patch for cvs HEAD (obsolete) — Splinter Review
Fix missing a header file inclusion.

I do not know why I noticed the missing. I would build with the patch...

Jeff, could you please review again? 

Thank you.
Attachment #328283 - Attachment is obsolete: true
Attachment #328299 - Flags: superreview?(bienvenu)
Attachment #328299 - Flags: review?(beckley)
Attachment #328283 - Flags: superreview?(bienvenu)
Attachment #328299 - Flags: review?(beckley) → review+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Thunderbird 3
Comment on attachment 328299 [details] [diff] [review]
Patch for cvs HEAD

the other option would be to do aAttachmentName = NS_ConvertUTF16toUTF8(description);
Attachment #328299 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 328284 [details] [diff] [review]
Patch for 1.8 branch

can't you go directly to aAttachmentName, i.e., rv = impSvc->SystemStringToUnicode(name.get(), aAttachmentName); ?
Use NS_ConvertUTF16toUTF8 instead of nsCString::Adopt.
Attachment #328299 - Attachment is obsolete: true
Attachment #328415 - Flags: superreview?(bienvenu)
Attachment #328415 - Flags: review?(beckley)
What I was suggesting is this:

+    rv = nsMsgI18NConvertToUnicode(nsMsgI18NFileSystemCharset(), name, aAttachmentName);
+ 
+    if (NS_FAILED(rv))
+      aAttachmentName = name

Does that work for you?
Unfortunately, no. 

Compiler says: "cannot convert nsCString to nsAString_internal &"
Comment on attachment 328415 [details] [diff] [review]
[checked in] Patch for CVS head.

ah, sorry, I got mixed up about what was an 8 bit string and what was a 16 bit string.
Attachment #328415 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 328284 [details] [diff] [review]
Patch for 1.8 branch

sr=me, but I'd prefer NS_ConvertUTF16toUTF8 instead of aAttachmentName.Adopt(ToNewUTF8String(description))
Attachment #328284 - Flags: superreview?(bienvenu) → superreview+
Use NS_ConvertUTF16toUTF8 instead of
aAttachmentName.Adopt(ToNewUTF8String(description)).

David, thank you for your specific instruction.
Attachment #328284 - Attachment is obsolete: true
Attachment #330673 - Flags: superreview?(bienvenu)
Attachment #330673 - Flags: review?(beckley)
Comment on attachment 328415 [details] [diff] [review]
[checked in] Patch for CVS head.

In the future, you can just continue on the r+ and/or sr+ if someone has given it to you with some small remaining corrections.
Attachment #328415 - Flags: review?(beckley) → review+
Attachment #330673 - Flags: review?(beckley) → review+
Comment on attachment 330673 [details] [diff] [review]
Revised patch for 1.8 branch

thx for the patch!
Attachment #330673 - Flags: superreview?(bienvenu) → superreview+
(In reply to comment #27)
> (From update of attachment 328415 [details] [diff] [review])
> In the future, you can just continue on the r+ and/or sr+ if someone has given
> it to you with some small remaining corrections.

Thank you! I surely do so next time.

Status: NEW → ASSIGNED
Keywords: checkin-needed
(In reply to comment #26)
> Created an attachment (id=330673) [details]
> Revised patch for 1.8 branch

You will need to request approval1.8.1.17 for this patch to be checked in (the HEAD patch will be done later). When requesting, you should also put a couple of comments about the likely risk to Thunderbird 2/SeaMonkey 1.1 as they are in stable release. I expect the risk here is low however.
Comment on attachment 330673 [details] [diff] [review]
Revised patch for 1.8 branch

I think there is no risk since falling back on the original name works if the conversion fails as Jeff advised in comment #8.
Attachment #330673 - Flags: approval1.8.1.17?
Comment on attachment 328415 [details] [diff] [review]
[checked in] Patch for CVS head.

Checked in, changeset id 721bb048b120
Attachment #328415 - Attachment description: Patch for CVS head. → [checked in] Patch for CVS head.
Is there any action what should/can I do for checking the patch in stable branch?
After/if it gets approval1.8.1.17+, add the keyword "checkin-needed" and put "[checkin-needed: 1.8 branch]" in status whiteboard.
Attachment #330673 - Flags: approval1.8.1.17? → approval1.8.1.17+
The other thing that sometimes helps speed approval is to resolve it FIXED when the trunk patch lands, so it's clear at a glance that it has already landed there.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [checkin-needed: 1.8 branch]
mailnews/import/eudora/src/nsEudoraWin32.cpp 1.43.24.2
Whiteboard: [checkin-needed: 1.8 branch]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: