Non Latin1 signature file in plain text is displaying as squares

VERIFIED FIXED in M17

Status

P3
normal
VERIFIED FIXED
19 years ago
10 years ago

People

(Reporter: marina, Assigned: nhottanscp)

Tracking

Trunk
x86
Windows NT

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta2+])

Attachments

(2 attachments)

(Reporter)

Description

19 years ago
Steps to reproduce:
-open Notepad;
-imput some JA text and save it as a text file;
-go to account preferences and check signature file;
-invoke a new mail composition window;
//note: the attached file look like garbage
(Assignee)

Comment 1

19 years ago
In M15, this feature is not working. Put depends on 32224.

The problem of japanese signature attach is that missing charset conversion.
We read raw data (in file system charset) but forgot to convert to unicode.
Reassign to ducarroz (owner of 32224), please apply following patch.

Index: src/nsMsgCompose.cpp
===================================================================
RCS file: /cvsroot/mozilla/mailnews/compose/src/nsMsgCompose.cpp,v
retrieving revision 1.157
diff -c -r1.157 nsMsgCompose.cpp
*** nsMsgCompose.cpp	2000/03/30 22:37:59	1.157
--- nsMsgCompose.cpp	2000/04/04 18:12:50
***************
*** 1852,1858 ****
    readSize = tempFile.read(readBuf, readSize);
    tempFile.close();
  
!   sigData = readBuf;
    PR_FREEIF(readBuf);
    return NS_OK;
  }
--- 1852,1859 ----
    readSize = tempFile.read(readBuf, readSize);
    tempFile.close();
  
!   if (NS_FAILED(ConvertToUnicode(nsMsgI18NFileSystemCharset(), readBuf, 
sigData)))
!     sigData = readBuf;
    PR_FREEIF(readBuf);
    return NS_OK;
  }
Assignee: nhotta → ducarroz
Depends on: 32224

Updated

19 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → M16

Updated

19 years ago
Keywords: nsbeta2

Comment 2

19 years ago
QA contact to marina.
QA Contact: momoi → marina

Comment 3

19 years ago
any luck with this patch?

Comment 4

19 years ago
[nsbeta2+]
Whiteboard: [nsbeta2+]
The actual code is different and therefore I don't think so I should apply this 
patch. Let me now if this bug still occurs. Thanks

Comment 6

19 years ago
J-F, this problem still occurs with 5/10/2000 Win32 build.

Comment 7

19 years ago
Mass moving M16 to M17 - look for nsbeta2 before anything else.
Target Milestone: M16 → M17
(Reporter)

Updated

19 years ago
Summary: Double-byte signature file in plain text is displaying a garbage → Double-byte signature file in plain text is displaying as squares
Reassign to rhp (per his request)
Assignee: ducarroz → rhp
Status: ASSIGNED → NEW

Updated

19 years ago
Status: NEW → ASSIGNED

Comment 9

19 years ago
To help me out, can someone attach a Japanese text file attachment to this bug 
for me to recreate.

Thanks.

- rhp
(Assignee)

Comment 10

19 years ago
Created attachment 8853 [details]
japanese text file

Comment 11

19 years ago
Thanks.

- rhp

Comment 12

19 years ago
Ok, I think I have Naoki's fix applied and running, but I'll need you guys to 
test if this is working.

- rhp
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 13

19 years ago
I used 2000052120 win32 commercial build (on Japanese localized WinNT4) and it 
is fixed for plain text mail. But I see dots when I tested HTML mail.
IQA, please verify this and reopen or file a separate bug for HTML mail.
(Reporter)

Comment 14

19 years ago
tested with 2000-05-22-09 build: there is only one scenario when it is working 
on Win NT JA : Mail composition set to Plain text and attachment is in txt 
format, everything else (html compose with txt or html signature, plain text 
with html signature ) fail.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 15

19 years ago
Naoki,
I think I need your help on this one. I'm not sure of the proper handling of 
some of the various combinations and I don't have a Japanese system to test on.

Thanks for the help.

- rhp
Assignee: rhp → nhotta
Status: REOPENED → NEW
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 16

19 years ago
The problem of HTML case is because of ToNewCString which is used in 
nsMsgCompose::ConvertTextToHTML.
Since nsEscapeHTML(tString) only takes char*, we may need to delay the 
conversion (from file system to unicode) after the HTML escape. 

1870   char *tString = origBuf.ToNewCString();
1871   if (tString)
1872   {
1873     char *escaped = nsEscapeHTML(tString);

This is also reproducible with US system by using symbol characters (e.g. Euro, 
tradmark). I will attach the data.
(Assignee)

Comment 17

19 years ago
Created attachment 9019 [details]
a signiture file which contains symbol characters out of ISO-8859-1.
(Assignee)

Comment 18

19 years ago
Html mail with html signature is actually working fine.
Plain text with html signature also works except if the html signiture file 
contains NCRs (but this is a problem of the content sink).
I have a fix for html mail with a plain text signiture case.
Summary: Double-byte signature file in plain text is displaying as squares → Non Latin1 signature file in plain text is displaying as squares
(Assignee)

Comment 19

19 years ago
I filed a separate bug (40350) for HTML with NCR.
(Assignee)

Comment 20

19 years ago
have a patch, r=rhp

Comment 21

19 years ago
a=bobj
(Assignee)

Comment 22

19 years ago
checked in yesterday
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago19 years ago
Resolution: --- → FIXED
(Reporter)

Comment 23

19 years ago
so the assumption is : it'll work on JA OS and won't on En? Do i test it only on 
JA system?
(Assignee)

Comment 24

19 years ago
Yes, this is OS charset dependent.

Comment 25

19 years ago
Is that true even for HTML signature files which contain
a meta-tag? If a signatue file is an attachment, it seems 
that we should be able to deal with it like any other
attachment - encode in B64, etc.
(Assignee)

Comment 26

19 years ago
When the html signature is converted to plain text, META charset may be used, 
but I am not sure. IF that is not working, please file a separate bug.
(Reporter)

Comment 27

19 years ago
verified with 2000-07-05 M17 build, html and plain text signatures are working 
on JA system.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.