Closed
Bug 70341
Opened 24 years ago
Closed 24 years ago
Non-ASCII attachment filename is not MIME encoded if filename is short, or with no or other extensions.
Categories
(MailNews Core :: Internationalization, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.4
People
(Reporter: ji, Assigned: jbetak)
Details
(Keywords: intl, regression, Whiteboard: nsbranch+)
Attachments
(4 files)
Build: 02/26 mtrunk Mac build
On Mac, whether the filename is MIME encoded or not depends on the
filename length. If the Ja filename contains 4 or less Japanese
chars,the filename won't get MIME encoded. If the filenames contains more chars,
it gets MIME encoded, but not correctly encoded if it is
sent from an English Mac OS. So the only working condition is to send
the mail from a Japanese MAC OS and the filename must contains 5 or more
Ja chars.
Steps to reproduce:
1. Launch Mail on JA Mac OS.
2. Send a mail with an JPN attachment filename which contains 4 or less Ja chars.
3. After the mail is received, view the attachment filename in the envelope or
view the message source of the mail, you'll see the attachment filename is not
MIME encoded.
4. Send a mail with an JPN attachment filename which conains 5 or more Ja chars.
This time the filename is MIME encoded.
5. Repeat step 4 on an En Mac OS + Ja language kit, you'll see the filename is
MIME encoded, but not correctly. The filename shows as a meaningless ASCII string.
Updated•24 years ago
|
Comment 3•24 years ago
|
||
Adding jenm to cc: list.
i18n thinks this is a cosmetic issue for mac users only. Suggest low priority.
Updated•24 years ago
|
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Comment 4•24 years ago
|
||
How about 6.0 and 6.01, are they working correctly?
Comment 6•24 years ago
|
||
cc to putterman, ducarroz.
Anything has changed since 6.0 around Macintosh attachment hanlding?
Keywords: regression
Comment 7•24 years ago
|
||
I have implemented support for AppleDouble!
Comment 8•24 years ago
|
||
IQA, could you try if this is reproducible with US system with European
characters then I can reassign to ducarroz?
i don't see any difference in files with short or long non-ascii string on Mac
with 2001-04-30 build ( they are both MIME encoded, first message has 4
non-ascii chars for file name , second one has 13 chars for file name)
Comment 10•24 years ago
|
||
Marina, are you saying this is "worksforme"?
| Reporter | ||
Comment 11•24 years ago
|
||
What kind of filenames have you tried with? European or Japanese or both? Are you on an En Mac OS?
Comment 12•24 years ago
|
||
as per Naoki's request i tried Europeen chars on US system ( Mac 9.0) with
language packs.
Comment 13•24 years ago
|
||
okay, looks like it's Japnese only.
Comment 14•24 years ago
|
||
looks like a serious one. leave it to moz0.9.2
Updated•24 years ago
|
Target Milestone: mozilla0.9.2 → mozilla0.9.3
| Reporter | ||
Comment 15•24 years ago
|
||
It's still happening on 06-27-04-0.9.2 Mac build.
Comment 16•24 years ago
|
||
frank, is this going to be fixed for RTM?
Comment 17•24 years ago
|
||
Comment 18•24 years ago
|
||
There are XP_MAC lines in nsMsgAttachmentHandler.cpp which seems to be doing
file name creation.
http://lxr.mozilla.org/seamonkey/source/mailnews/compose/src/nsMsgAttachmentHand
ler.cpp#570
I do not see charset conversion there (from OS charset to mail charset), so
probably we need it there. But I am not sure about why MIME encode is missing
for Macintosh only.
Anyway, I feel changing the attachment code now is not low risk.
Jean-Francois, what do you think?
Comment 19•24 years ago
|
||
I found the reason of this. In the following code "m_real_name" contains MIME
encoded string and "tempName" contains broken (non MIME) string. In case of
Macintosh, if the string is more than 31 character length then "tempName" is
deleted and "m_real_name" won't be overwritten (see line 549). That's why this
happens when the file name is short.
But the problem should always happen for Windows since "m_real_name" is always
overwritten by "tempName". Xianglang, could you test this on Windows?
532 tempName = GenerateFileNameFromURI(mURL); // Make it a sane name
533 #ifdef XP_MAC
534 if (tempName && PL_strlen(tempName) >= 31)
535 PR_DELETE(tempName)
536 #endif
537 538 mCompFields = compFields;
539 540 // First, get as file spec and create the stream for the
541 // temp file where we will save this data
542 if ((!tempName) || (!*tempName))
543 mFileSpec = nsMsgCreateTempFileSpec("nsmail.tmp");
544 else
545 mFileSpec = nsMsgCreateTempFileSpec(tempName);
546 547 // Set a sane name for the attachment...
548 if (tempName)
549 m_real_name = PL_strdup(tempName);
550
http://lxr.mozilla.org/seamonkey/source/mailnews/compose/src/nsMsgAttachmentHand
ler.cpp#521
| Reporter | ||
Comment 20•24 years ago
|
||
Did more testing on this, here is results:
1. On windows and linux, the Ja attachment file get MIME encoded or not depends
on the extension of the file, not on the filename length. No matter how long
the filename is, as long as the extension is not .txt or .html, the filename
doesn't get MIME encoded. For example, file with .doc, or .blt or w/o any
extension will be sent out with filename in escaped format.
2. On Mac, it depends on the filename length. Even the file doesn't any
extension, the system can figure out the file type ( you can see this by looking
at the icon).
Due to this problem, fix for bug 68993 (unable to send out attachment file with
filename containing Shift-JIS trail byte 7C) won't work for the file with no
or other file extensions.
Changed platform to ALL, priority to P1, Severity to critical.
Added nsbeta1 keyword.
Modified the summary accordingly.
Severity: normal → critical
Keywords: nsbeta1
Priority: -- → P1
Hardware: Macintosh → All
Summary: JPN attachment filename is not MIME encoded if the filename contains 4 or less Ja chars → JPN attachment filename is not MIME encoded if filename is short, or with no or other extensions.
Comment 21•24 years ago
|
||
same is true for Latin-1 names
| Reporter | ||
Comment 22•24 years ago
|
||
Modified the summary based on Marina's comments.
Summary: JPN attachment filename is not MIME encoded if filename is short, or with no or other extensions. → Non-ASCII attachment filename is not MIME encoded if filename is short, or with no or other extensions.
Comment 23•24 years ago
|
||
too risky and no data lost. mark it as future.
Target Milestone: mozilla0.9.3 → Future
| Reporter | ||
Comment 24•24 years ago
|
||
On Windows, for an ASCII atachment file with the filename like test[aaa.doc, the
filename will show as test%5Baaa.doc after received.
Comment 25•24 years ago
|
||
i think it might be related to bug # 75449 ( though that bug doesn't deal with
.doc and other file formats)
Comment 26•24 years ago
|
||
Comment 27•24 years ago
|
||
cc'ing varada
Comment 29•24 years ago
|
||
nhotta said this one is cosmetic , we can still send the file out but the file
name is broken but no data will lost, the attachement will still be send out and
received correctly.
On window, this can only be reproduce in the following condiction:
not HTML, not TXT, The extension type is something we don't have with MIME mapping.
> ji@netscape.com 2001-06-28 12:37 -------
>Due to this problem, fix for bug 68993 (unable to send out attachment file with
>filename containing Shift-JIS trail byte 7C) won't work for the file with no
>or other file extensions.
This assumption is in correct. There are two seperate caused. Nhotta is fixing
68993 now. I think we need to fix 68993, but not this oen.
Comment 30•24 years ago
|
||
msanz, I want to remove the PDT+ here. The patch have more risk and I think it
is not worthy because it only happen on edge cases. And even it happen, it does
not look that bad.
Updated•24 years ago
|
Target Milestone: Future → ---
Updated•24 years ago
|
Priority: P1 → P2
Comment 32•24 years ago
|
||
Sorry for the delay. Looks good. R=ducarroz
| Assignee | ||
Comment 33•24 years ago
|
||
reassigning to myself, nhotta is on sabbatical.
seth: could you sr this? I'd land it for nhotta then...
Assignee: nhotta → jbetak
Status: ASSIGNED → NEW
Comment 34•24 years ago
|
||
see http://www.emaillab.org/essay/japanese-filename.html (in Japanese..)
It is necessary to implement RFC2231 and/or MIME B encoding for non-ascii
attachment filename.
# In Japan, Mime-B is defact (80%). But it is not so good (ref: RFC2047 5).
Comment 35•24 years ago
|
||
mark it as nsbranch+ and move to m0.9.4
Whiteboard: nsbranch+
Target Milestone: --- → mozilla0.9.4
Comment 36•24 years ago
|
||
sr=sspitzer, but please make sure to test nothing breaks on US-ASCII machines.
| Assignee | ||
Comment 37•24 years ago
|
||
fix checked in - thanks everyone!
marina, xianglang - could you please watch out for any non-Japanese attachment
file name regressions?
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 38•24 years ago
|
||
Verified with 08/22 build. It's fixed, and there are no regressions to
non-Japanese attachment filenames.
Updated•20 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
•