The default bug view has changed. See this FAQ.

Cannot open detached file from the message if its filename or pathname contains Japanese character

VERIFIED FIXED in mozilla1.8beta5

Status

MailNews Core
Internationalization
--
major
VERIFIED FIXED
12 years ago
9 years ago

People

(Reporter: u69748, Assigned: masayuki)

Tracking

({fixed1.8, intl})

Trunk
mozilla1.8beta5
x86
Windows XP
fixed1.8, intl
Bug Flags:
blocking1.8b5 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050907 (No IDN) Firefox/1.4
Build Identifier: Thumderbird 1.5 beta 1

Cannot open detached file from the message if its filename or pathname contains
Japanese character.


Reproducible: Always

Steps to Reproduce:
1.Crate message with attachment which filename contains Japanese character.
2.Detach the attachment.
3.Double click the attachment.

Actual Results:  
Nothing happens.

Expected Results:  
Detached file should be opend.
(Reporter)

Comment 1

12 years ago
Created attachment 195866 [details]
sample mbox

This contains 3 messages
1: Original mesage with a attachment which filename contains Japanese
(¥Æ¥¹¥È.txt).
2: Attachment is detached to C:/
3: Attachment is detached to
C:/Documents%20and%20Settings/level/%83f%83X%83N%83g%83b%83v/
   (in Japanese: C:/Documents%20and%20Settings/level/¥Ç¥¹¥¯¥È¥Ã¥×/ )
(Reporter)

Comment 2

12 years ago
In Japanese environment, detach can not be used because of this bug.
Flags: blocking1.8b5?

Comment 3

12 years ago
Scott, this seems like a pretty big failure in a new feature. Will you guys have
time to look into this for 1.5 b2?

Comment 4

12 years ago
yes we should fix this
Flags: blocking1.8b5? → blocking1.8b5+
Target Milestone: --- → Thunderbird1.1

Comment 5

12 years ago
Created attachment 195929 [details] [diff] [review]
fix for problem noticing that detach failed.

I had a problem even detaching the attachment in the provided test case, so
I've fixed that handling of that error.  I think the filename was what caused
the problem detaching.

I'm not convinced the problem reported has to do with filenames - it could just
have to do with that we've left the content type as base64 encoded, when it's
not, since we decode when we do a save as.
Assignee: mscott → bienvenu
Status: UNCONFIRMED → ASSIGNED
Attachment #195929 - Flags: superreview?(mscott)

Comment 6

12 years ago
see bug 308321 for the encoding issue.

Updated

12 years ago
Attachment #195929 - Flags: superreview?(mscott)
Attachment #195929 - Flags: superreview+
Attachment #195929 - Flags: approval1.8b5+

Comment 7

12 years ago
Hideyuki, can you try with tomorrow's build, and see if it was the content
transfer encoding that caused the problem? I can't test with japanese characters
here...
(Reporter)

Comment 8

12 years ago
I have tried with 1.5 Beta 1 (20050915).

The problem is not fixed.
Detached part is following.

--------------020503070406020209030308
Content-Type: text/plain;
 name*=ISO-2022-JP''%1B%24B%25F%259%25H%1B%28B.txt
Content-Disposition: attachment; filename="���������.txt"
X-Mozilla-External-Attachment-URL:
file:///C:/Documents%20and%20Settings/level/%83f%83X%83N%83g%83b%83v/%83e%83X%83g.txt
X-Mozilla-Altered: AttachmentDetached; date="Fri Sep 16 00:40:14 2005"

The original MIME headers for this attachment are:
Content-Type: text/plain;
 name*=ISO-2022-JP''%1B%24B%25F%259%25H%1B%28B.txt
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename*=ISO-2022-JP''%1B%24B%25F%259%25H%1B%28B.txt


--------------020503070406020209030308--

Still I cannot open the file.
And error page says:

File Not Found
The file /C:/Documents and Settings/level/ƒfƒXƒNƒgƒbƒv/ƒeƒXƒg.txt cannot be
found. Please check the location and try again.

BTW, I think this error page is not suitable for this case.
(Reporter)

Comment 9

12 years ago
(In reply to comment #8)
> X-Mozilla-External-Attachment-URL:
>
file:///C:/Documents%20and%20Settings/level/%83f%83X%83N%83g%83b%83v/%83e%83X%83g.txt

Firefox can open the detached file by this URL.

Comment 10

12 years ago
Jungshik, any ideas about this? Presumably it's a filename escaping problem...
(Assignee)

Comment 11

12 years ago
I think that this is a bug.

nsMessenger::OpenURL
> 586   else
> 587   {
> 588     nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mDocShell));
> 589     if(webNav)
> 590       rv = webNav->LoadURI(NS_ConvertASCIItoUCS2(unescapedUrl).get(), //
URI string
> 591       nsIWebNavigation::LOAD_FLAGS_IS_LINK, // Load flags
> 592       nsnull,                               // Referring URI
> 593       nsnull,                               // Post stream
> 594       nsnull);                              // Extra headers
> 595   }

I will test tonight or later.
# working on other bugs now...
(Assignee)

Comment 12

12 years ago
Previous comment is here:
http://lxr.mozilla.org/mozilla/source/mailnews/base/src/nsMessenger.cpp#562

And called by here:
http://lxr.mozilla.org/mozilla/source/mail/base/content/msgHdrViewOverlay.js#1147
(Assignee)

Comment 13

12 years ago
Created attachment 196690 [details] [diff] [review]
Patch rv1.0
Assignee: bienvenu → masayuki
Attachment #195866 - Attachment is obsolete: true
Attachment #195929 - Attachment is obsolete: true
Attachment #196690 - Flags: review?(mconnor)
(Assignee)

Updated

12 years ago
Attachment #196690 - Flags: review?(mconnor)
(Assignee)

Comment 14

12 years ago
Created attachment 196691 [details] [diff] [review]
Patch rv1.0

I think that we don't need to unescape the URL for nsIWebNavigation::LoadURI.
This patch makes to open the detached file. But the description is broken. This
is another bug.
Attachment #196690 - Attachment is obsolete: true
Attachment #196691 - Flags: review?(mconnor)
Comment on attachment 196691 [details] [diff] [review]
Patch rv1.0

sorry, I'm not a mailnews peer, try bienvenu or mscott
Attachment #196691 - Flags: review?(mconnor)
(Assignee)

Updated

12 years ago
Attachment #196691 - Flags: review?(bienvenu)
(Assignee)

Comment 16

12 years ago
Junkshik:

If you have a time, please look the patch.
Keywords: intl

Comment 17

12 years ago
Comment on attachment 196691 [details] [diff] [review]
Patch rv1.0

I tried this on imap and pop3, and it worked fine on my test cases. Thx for the
patch! Scott, do you have some interesting test cases for this?
Attachment #196691 - Flags: superreview?(mscott)
Attachment #196691 - Flags: review?(bienvenu)
Attachment #196691 - Flags: review+
(Assignee)

Updated

12 years ago
Component: Mail Window Front End → MailNews: Internationalization
Flags: review+
Product: Thunderbird → Core
Target Milestone: Thunderbird1.1 → mozilla1.8beta5
Version: unspecified → Trunk
(Assignee)

Comment 18

12 years ago
Comment on attachment 196691 [details] [diff] [review]
Patch rv1.0

Oops. review flag is gone by changing product.

r=bienvenu
Attachment #196691 - Flags: review+
(Assignee)

Updated

12 years ago
Depends on: 309335

Comment 19

12 years ago
Comment on attachment 196691 [details] [diff] [review]
Patch rv1.0

I'm not a huge fan of adding the early returns to the code, I thought the old
organization was better. But using ConvertASCIItoUTF16 looks good to me. 

approving for the branch too.
Attachment #196691 - Flags: superreview?(mscott)
Attachment #196691 - Flags: superreview+
Attachment #196691 - Flags: approval1.8b5+
(Assignee)

Comment 20

12 years ago
checked-in to trunk and 1.8branch.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
(Reporter)

Comment 21

12 years ago
Windows XP, version 1.5 Beta 1 (20050922)
I have comfirmed the fix of this bug.
Thanx!
Status: RESOLVED → VERIFIED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.