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

Extended-ASCII chars are only convert to ASCII during export if the SUB_ASCII

toggle is set.
Extended-ASCII chars in the message Subject are now converted as well.
Extended-ASCII chars can now be converted during import by using the 'a'
(ASCII only) area flag in the newslink.cfg file.
parent 9db35e91
Branches
Tags
No related merge requests found
...@@ -11,9 +11,15 @@ ...@@ -11,9 +11,15 @@
// port TCP port number (defaults to 119) // port TCP port number (defaults to 119)
// user username (optional) // user username (optional)
// pass password (optional) // pass password (optional)
// area subboard (internal code) newsgroup // area subboard (internal code) newsgroup flags
// ... // ...
// Defined area flags:
// x do not add tearlines & taglines to exported messages
// n do not add "From Newsgroup" text to imported messages
// t do not add tearline to imported messages
// a convert extended-ASCII chars to ASCII on imported messages
const REVISION = "$Revision$".split(' ')[1]; const REVISION = "$Revision$".split(' ')[1];
printf("Synchronet NewsLink %s session started\r\n", REVISION); printf("Synchronet NewsLink %s session started\r\n", REVISION);
...@@ -263,18 +269,25 @@ for(i in area) { ...@@ -263,18 +269,25 @@ for(i in area) {
if(hdr.from_net_type==NET_INTERNET) /* no dupe loop */ if(hdr.from_net_type==NET_INTERNET) /* no dupe loop */
continue; continue;
if(hdr.from_net_type /* don't gate messages between net types */ if(hdr.from_net_type /* don't gate messages between net types */
&& msgbase.settings!=null && !(msgbase.settings&SUB_GATE)) && msgbase.settings!=undefined && !(msgbase.settings&SUB_GATE))
continue; continue;
body = msgbase.get_msg_body(false, ptr body = msgbase.get_msg_body(
false /* retrieve by offset */
,ptr /* message number */
,true /* remove ctrl-a codes */ ,true /* remove ctrl-a codes */
,true /* rfc822 formatted text */ ,true /* rfc822 formatted text */
,true /* include tails */); ,true /* include tails */
);
if(body == null) { if(body == null) {
printf("!FAILED to read message number %ld\r\n",ptr); printf("!FAILED to read message number %ld\r\n",ptr);
continue; continue;
} }
body = ascii_str(body); if(msgbase.settings!=undefined && msgbase.settings&SUB_ASCII) {
/* Convert Ex-ASCII chars to approximate ASCII equivalents */
body = ascii_str(body);
hdr.subject = ascii_str(hdr.subject);
}
if(flags.indexOf('x')==-1) { if(flags.indexOf('x')==-1) {
body += tearline; body += tearline;
body += tagline; body += tagline;
...@@ -529,6 +542,11 @@ for(i in area) { ...@@ -529,6 +542,11 @@ for(i in area) {
continue; continue;
} }
if(flags.indexOf('a')>=0) { // import ASCII only (convert ex-ASCII to ASCII)
body = ascii_str(body);
hdr.subject = ascii_str(hdr.subject);
}
hdr.from_net_type=NET_INTERNET; hdr.from_net_type=NET_INTERNET;
// hdr.from_net_addr=hdr.from; // hdr.from_net_addr=hdr.from;
if(flags.indexOf('t')==-1) if(flags.indexOf('t')==-1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment