Closed Bug 51608 Opened 24 years ago Closed 24 years ago

File with non-ascii name doesn't get attached

Categories

(MailNews Core :: Internationalization, defect, P2)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: marina, Assigned: nhottanscp)

Details

(Whiteboard: [nsbeta3+])

Steps to reproduce:
- open New Mail Composition;
- click on the Attach icon, browse for the file with non-ascii name;
//note: in the attachment pane nothing shows up
//when you'll get the mail you'll equaly see that the body is blank and no 
attachment envelope is displayed
dup of bug 43689?
this bug has nothing to do with 43689. There the attachment is getting sent but 
has display problems , in this case it is not sent out at all
CC to alecf, ducarroz, jefft.
It dumps on my debug build as following.
One thing I see is that the file name is not encoded in UTF-8 but used OS 
charset (windows-1252 in my case).
I cannot reproduce this with PR2.

AttachFile()
nsIFilePicker - file:///D:/%80%80%80.txt
************************************************************
** NOTE: This report will only be printed in DEBUG builds.**
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "[Exception... "Unexpected error"  code: "-2147418113" nsresult: "
0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "chrome://messenger/content/messeng
ercompose/MsgComposeCommands.js Line: 1369"] [nsIController::doCommand]"  nsresu
lt: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame :: chrom
e://global/content/globalOverlay.js :: goDoCommand :: line 73"  data: no]
************************************************************
An error occurred executing the cmd_attachFile command
Status: NEW → ASSIGNED
Keywords: nsbeta3
it's maybe a problem related to the use of the new file picker (nsIFilePicker) 
varada make the change for few weeks ago.
Setting 8 bit string to tooltip causes an error. In MsgComposeCommands.js,
cell.setAttribute("tooltiptext", unescape(attachment)); 

We can avoid the error by not unescaping for the tooltip and that fixes this 
bug.
We need more investigation to show escaped url correctly for tooltip (but that 
is lower priority).
Noaki, you should try this:

try { 
      cell.setAttribute("tooltiptext", unescape(attachment)); 
      } catch (e) {cell.setAttribute("tooltiptext", attachment)} 
I think this is serious enough to be nsbeta3+ P2
Priority: P3 → P2
Whiteboard: [nsbeta3+]
Jean-Francois's patch fixed the problem, thanks.
I checked in the patch.
Because 8 bit file names are not unescaped with this patch, tooltip shows 
escaped file name for 8 bit file names. I will file a separate bug. 
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
To marina for verification. Thanks.
QA Contact: momoi → marina
verified with 2000-09-14 build, i don't see it happening anymore.
Status: RESOLVED → VERIFIED
*** Bug 52697 has been marked as a duplicate of this bug. ***
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.