Fix for incorrect charset on reply - Bug # 3979 - r: mscott

This commit is contained in:
rhp%netscape.com 2000-02-04 22:52:55 +00:00
Родитель 5fef87419a
Коммит 594dddaf04
3 изменённых файлов: 30 добавлений и 1 удалений

Просмотреть файл

@ -1433,7 +1433,7 @@ static int WriteOutEachVCardPhoneProperty (MimeObject *obj, VObject* o)
PR_FREEIF (attribName);
return status;
}
status = WriteLineToStream (obj, attribName, PR_FALSE);
status = WriteLineToStream (obj, attribName, PR_TRUE);
if (status < 0) {
PR_FREEIF (attribName);
return status;

Просмотреть файл

@ -1359,6 +1359,17 @@ MimeObject_output_init(MimeObject *obj, const char *content_type)
if (!content_type)
content_type = TEXT_PLAIN;
//
// Set the charset on the channel we are dealing with so people know
// what the charset is set to. Do this for quoting/Printing ONLY!
//
extern void ResetChannelCharset(MimeObject *obj);
if ( (obj->options) &&
( (obj->options->format_out == nsMimeOutput::nsMimeMessageQuoting) ||
(obj->options->format_out == nsMimeOutput::nsMimeMessageBodyQuoting) ||
(obj->options->format_out == nsMimeOutput::nsMimeMessagePrintOutput) ) )
ResetChannelCharset(obj);
status = obj->options->output_init_fn (content_type, charset, name,
x_mac_type, x_mac_creator,
obj->options->stream_closure);

Просмотреть файл

@ -1633,3 +1633,21 @@ MimeGetStringByID(PRInt32 stringID)
else
return tempString;
}
void
ResetChannelCharset(MimeObject *obj)
{
if (obj->options && obj->options->stream_closure &&
obj->options->default_charset && obj->headers )
{
mime_stream_data *msd = (mime_stream_data *) (obj->options->stream_closure);
char *ct = MimeHeaders_get (obj->headers, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE);
if ( (ct) && (msd) && (msd->channel) )
{
char *ptr = PL_strstr(ct, "charset=");
if (ptr)
msd->channel->SetContentType(ct);
PR_FREEIF(ct);
}
}
}