Skip to content
Snippets Groups Projects
Commit b34cba6a authored by rswindell's avatar rswindell
Browse files

write_news_header() will now add Content-type (cp437) and content-transfer

-encoding (8bit) header fields if no content-type has already been specified in
the message header. This allows messages containing extended-ASCII to be
rendered correctly in news readers.
parent bdebb3c9
No related branches found
No related tags found
No related merge requests found
......@@ -42,12 +42,23 @@ function write_news_header(hdr,writeln)
if(hdr.ftn_reply!=undefined)
writeln("X-FTN-REPLY: " + hdr.ftn_reply);
var content_type;
if(hdr.field_list!=undefined) {
for(i in hdr.field_list)
if(hdr.field_list[i].type==RFC822HEADER)
if(hdr.field_list[i].type==RFC822HEADER) {
if(hdr.field_list[i].data.toLowerCase().indexOf("content-type:")==0)
content_type = hdr.field_list[i].data;
writeln(hdr.field_list[i].data);
}
}
if(content_type==undefined) {
/* No content-type specified, so assume IBM code-page 437 (full ex-ASCII) */
writeln("Content-Type: text/plain; charset=cp437");
writeln("Content-Transfer-Encoding: 8bit");
}
}
function parse_news_header(hdr, line)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment