Closed Bug 82591 Opened 23 years ago Closed 23 years ago

HTML mail from News.com has '?' in the body (using IMAP)

Categories

(MailNews Core :: Internationalization, defect, P4)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.6

People

(Reporter: dyp, Assigned: nhottanscp)

References

Details

(Keywords: intl)

Attachments

(8 files)

HTML mail from News.com doesn't seem to understand certain tags that are not 
visible.  I have '?' appearing through the mail.  Displays fine in 4.x 
Messenger.
can you attach the rfc/822 message to this bug?

load the message, and do "File | Save As | File".
Attached file saved mail file
The message claims to use charset="us-ascii", but actually uses 8 bits (0xA0,
non-breaking space in ISO-8859-1). 0xA0 appears as '?' here, which is correct
because it isn't defined in US-ASCII.
But it seems to work fine in all other browsers N4.x as well as IE
that attached mail file worked fine for me on win2k.

I'll try my winnt and win98 builds.

cc'ing nhotta who would know what we are supposed to do in this case.
works for me on my win98 box running 20001052504.

dyp, do you see the problem when you save
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=36098 as "foo.eml" and
then open it up in the brower?

if not, I'll turn it into a folder and see if I can see it.
saved it as *.eml file and viewd in Browser.  Looks fine in the browser.
I think the question marks are non breaking spaces.
Nbsp is not in "us-ascii" range. In the message charset is set to "us-ascii".
Content-Type: text/html; charset="us-ascii"

I think the question mark will also appear in HTML if that explicitly labeled as
"us-ascii" like below.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">

David, could you try that?
Not a mail-only problem.  Over to i18n.

I would probably suggest wontfix on this one....
Assignee: sspitzer → nhotta
Status: UNCONFIRMED → NEW
Component: Mail Window Front End → Internationalization
Ever confirmed: true
OS: Windows 2000 → All
Product: MailNews → Browser
QA Contact: esther → andreasb
Hardware: PC → All
There is optimization in mail code for "US-ASCII".
We could verify the data is really 7 bit before applying the optimization.
That would prevent invalid UTF-8 data to be sent to the layout and might also 
fix this problem.
Target Milestone: --- → Future
Status: NEW → ASSIGNED
Switching qa contact to ji@netscape.com for now.
QA Contact: andreasb → ji
Target Milestone: Future → mozilla0.9.3
Looks good but the code

+    // make sure if the data is really ASCII in order to prevent generating
illegal UTF-8
+    PRInt32 len = inLength;
+    PRBool bASCII = PR_TRUE;
+    for (PRInt32 i = 0; i < inLength; i++) {
+      if (inBuffer[i] & 0x80) {
+        bASCII = PR_FALSE;
+        break;
+      }
     }

can be written more efficiently! You can use a pointer instead of a array. Also,
you could scan 32bits data at once instead of 8bits.
R=ducarroz if you replace the line

+      if (*p & (PRUint32)0x80000000) {

by

+      if (*p & (PRUint32)0x80808080) {

sr=sspitzer

assuming that similar code doesn't already live somewhere else in the tree.
Fixed in trunk.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
it looks like there is similar code else where.

see nsMsgSearchOnlineMail::Encode() in nsMsgImapSearch.cpp

I'll log a bug on nhotta (or ducarroz) to move that code out and into a common 
place.
I opened bug #92220 to track the duplicate code.
Reopen, the change was backed out because of a regression bug 92330.
nsMsgHeaderParser also calls it with a wrong charset, filed as bug 92420.
Status: RESOLVED → REOPENED
Depends on: 92420
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
Target Milestone: mozilla0.9.3 → ---
The last patch has a problem. If the srs cad dst charsets are equal then it
should just dup the string no 7 bit check is needed.
Product: Browser → MailNews
reassign to jbetak and mark m9.4
Assignee: nhotta → jbetak
Status: ASSIGNED → NEW
Keywords: intl
Target Milestone: --- → mozilla0.9.4
nominating for nsbranch
Status: NEW → ASSIGNED
Whiteboard: nsbranch
Per Selmer suggestion, I am doing this myself.

Moving nsbranch designation from the Status Whiteboard to Keywords.
Keywords: nsbranch
Whiteboard: nsbranch
so... this is a bug for mailer which does not implement MIME correctly. Delay
the fix till nhotta back. mark it as m0.9.6
Target Milestone: mozilla0.9.4 → mozilla0.9.6
Blocks: 99171
nsbranch- since Frank moved it to 0.9.6
Keywords: nsbranchnsbranch-
Reassign to nhotta.
Assignee: jbetak → nhotta
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Priority: -- → P4
*** Bug 104282 has been marked as a duplicate of this bug. ***
By bug 92420, this is not used by headers.
And part of bug 12481 caches charset convertors in mime object. After that is
fixed, we can remove the optimization code for us-ascii.
Depends on: 12481
Comment on attachment 43301 [details] [diff] [review]
Patch, changed 0x80000000 to 0x80808080.

R=ducarroz, SR=sspitzer
Attachment #43301 - Flags: superreview+
Attachment #43301 - Flags: review+
Comment on attachment 54880 [details] [diff] [review]
If charset is "us-ascii" then use "ISO-8859-1".

I far I know, us-ascii == ISO-8859-1. R=ducarroz
Attachment #54880 - Flags: review+
Comment on attachment 54880 [details] [diff] [review]
If charset is "us-ascii" then use "ISO-8859-1".

sr=sspitzer

the strcasecmp is fine, since both are C strings.
Attachment #54880 - Flags: superreview+
Checked in to the trunk.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Verified as fixed with the latest build.
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.

Attachment

General

Creator:
Created:
Updated:
Size: