Closed Bug 107869 Opened 23 years ago Closed 23 years ago

Reply mail doesn't inherit the original charset

Categories

(MailNews Core :: Internationalization, defect)

PowerPC
Mac System 9.x
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED WORKSFORME

People

(Reporter: ji, Assigned: nhottanscp)

References

Details

(Keywords: intl, regression)

Attachments

(2 files, 1 obsolete file)

build: 10/31 trunk build.

Reply mail doesn't inherit the charset of the original mail, instead it's using
the folder charset. so as long as the folder charset is not consistent with the
charset in the MIME header, the quoted mail will be garbled on reply mail
compose window. And this only happens to single part mail.

Steps to reproduce:
1. Have a single part ISO-2022-JP mail in you mail box. Make sure the foler
charset is not ISO-2022-JP.
2. Select the mail and click on Reply, you can see the quoted mail is garbled.
3. Change the folder charset to ISO-2022-JP, and select the mail and click on
Reply again. This time the quoted mail is displayed alright.
Since the original mail has MIME charset info, reply mail should inherit that
charset, it shouldn't use folder charset.
Keywords: intl, regression
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.6
I think this is related to the change of mimemsg.cpp rev=1.36.
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=mimemsg.cpp&root=/cvsroot&subdir=mozilla/mailnews/mime/src&command=DIFF_FRAMESET&rev1=1.35&rev2=1.36

That is the place to set the original message's charset for a single part message.
Reassign to shanjian, please take a look at this.
Assignee: nhotta → shanjian
Status: ASSIGNED → NEW
It is working with 2001-10-30-03-trunk, so it should be something else.
Reassign back, sorry about that.
Assignee: shanjian → nhotta
Shanjian, I have to reassign again.
I backed out your check in of yesterday (mimetext.cpp, mimetext.h) and that
fixed the problem.
I think you want to fix bug 107084 differently.
E.g., you can check 'obj->options->override_charset' at
MimeInlineText_rotate_convert_and_parse_line that is safer than your last change.
Assignee: nhotta → shanjian
It looks like a regression caused by the fix for bug 107084.

Adding shanjian to the CC: list.
Oh, sorry. Seems you already know that...
shirley, can you try with a build before last tuesday?  I want to know if you 
specified a folder charset, and checked "apply default charset to all 
message...", will the reply message use override charset or header specified 
charset? Thanks.

Status: NEW → ASSIGNED
Shanjian, the problem reported in this report doesn't exist on 10/29 trunk
build. And with 10/29 build, if I force the folder charsert override, reply mail
still inherit the charset of the original mail, it doesn't use the folder
charset, which is the correct behaviour.
*** Bug 107983 has been marked as a duplicate of this bug. ***
changed platform to all and upgraded to critical...

workaround is to set the charset on the message _before_ replying to it.
Severity: normal → critical
OS: Windows 2000 → All
Hardware: PC → All
I found what is the problem, I am working on a fix. 
Attached patch proposed fix (obsolete) (deleted) — Splinter Review
Some explaination to the problem and my solution:
Before my patch in 107084, the text->charset is tried to resolve in 
"MimeInlineText_initialize", at which time obj->option hasn't been 
passed in yet. But header is available and text->charset can take 
over its value if it is available. When I fixing 107084, I delay 
text->charset initialization until everything is available, which 
happens after we begin to parse. However, in MimeMessage_close_headers
we need to set charset for message window, and it relies on text->charset
to be available and it will try to resolve charset from obj->option 
itself. 

Solution:
We don't want to resolve charset in two different places. The approach 
used before patch 107084 also has some problems. If the charset is
from autodetect or html metachar, message window's charset will not be 
updated. User will eventual see different charset used in viewing mail 
and replying mail. That's undesired. So I let MimeMessage instruct 
MimeInlineText either message window's charset need to be updated or not, 
and let MimeInlineText do the work. 

Whiteboard: need r/sr
I think most of the messages has charset specified.
Delay charset initialization is for special cases like override or auto-detection.
I am not sure why can't we initialize it as before and reset the value when
needed later (e.g by detected charset).
It seems to me complicated, having three flags (inputAutodetect,
initializeCharset, needUpdateMsgWinCharset).

You can set it as before, but how can you update it without setting a flag?
In case of a multi-part message, only the first mime part should update the 
character set for message window. We can avoid this flag if we don't care about 
autodetection, but I am afraid that is not a acceptable solution. 
One of the example is when the main body does not have a charset and auto-detect
is on, right? If no other way to check the body has no charset then you need a
flag, I agree.
Can 'initializeCharset' be used if the body has a charset or not?
was the fixed for this checked in?  I am not seeing this problem with this 
mornings smoketesting.
No, the fix hasn't been checked in yet. 
Attached patch updated patch (deleted) — Splinter Review
Attachment #56109 - Attachment is obsolete: true
I have done smoketesting and several other testing as suggested by naoki. No 
problem found. 

Ducarroz, can you review my patch?
Comment on attachment 56267 [details] [diff] [review]
updated patch

Looks good. R=ducarroz
Comment on attachment 56267 [details] [diff] [review]
updated patch

sr=sspitzer
Attachment #56267 - Flags: superreview+
fix checked in. 
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified with 11/19 trunk builds. It's fixed.
Status: RESOLVED → VERIFIED
this has reappeared on mac build 2001-11-20-04-trunk

Status: VERIFIED → REOPENED
OS: All → Mac System 9.x
Hardware: All → Macintosh
Resolution: FIXED → ---
Naoki, could you take a look on mac? 
Assignee: shanjian → nhotta
Status: REOPENED → NEW
Whiteboard: need r/sr
Status: NEW → ASSIGNED
Target Milestone: mozilla0.9.6 → ---
I don't see this, reply mail inherits its original charset, it doesn't take the
folder charset. But I do see the attachment charset is overwritten by the mail
body (bug 111055) and that is on all the platforms.
I tried mac build 2001-11-20-04-trunk and it's working except the problem 
reported as bug 111055.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → WORKSFORME
verified on mac commercial build 2001-11-26-04-trunk
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: