Skip to content
Snippets Groups Projects
Commit 0546fa33 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Do the FTN CHRS kludge to MIME charset translation for CP866->koi8-r

for Al (TRMB) and his Russian users, requested via DOVE-Net.

Do an FTN "ASCII 1" -> "US-ASCII" translation of the CHRS->charset too.
parent 48ef9438
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
require("mailutil.js", 'mail_get_name'); require("mailutil.js", 'mail_get_name');
require("smbdefs.js", 'RFC822HEADER'); require("smbdefs.js", 'RFC822HEADER');
function write_news_header(hdr,writeln) function write_news_header(hdr,writeln)
{ {
/* Required header fields */ /* Required header fields */
...@@ -67,7 +67,22 @@ function write_news_header(hdr,writeln) ...@@ -67,7 +67,22 @@ function write_news_header(hdr,writeln)
} }
} }
if(content_type==undefined) { if(content_type==undefined) {
var charset = hdr.text_charset || (hdr.is_utf8 ? "UTF-8" : "IBM437"); var charset = hdr.text_charset;
if(!charset) {
if(hdr.is_utf8)
charset = "UTF-8";
else switch(hdr.ftn_charset) {
case "ASCII 1":
charset = "US-ASCII";
break;
case "CP866 2":
charset = "KOI8-R";
break;
default:
charset = "IBM437";
break;
}
}
writeln("Content-Type: text/plain; charset=" + charset); writeln("Content-Type: text/plain; charset=" + charset);
writeln("Content-Transfer-Encoding: 8bit"); writeln("Content-Transfer-Encoding: 8bit");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment