Subj : Re: newsutil.js - content
To : Digital Man
From : Ash-Fox
Date : Tue Nov 20 2007 07:14 pm
Digital Man wrote:
>
> I'm not really sure what to suggest in that case. <shrug>
>
Well after a bit of thinking, I came up with this code, which appears to
work well. It's a bit of hack though, and I'm not sure if this logic does
enough to determine a message came from usenet.
if(content_type==undefined) {
//Check that we're not from Fidonet
if(hdr.ftn_area==undefined) {
//If we don't have a ftn, we're likely not from usenet, needs header.
if(hdr.ftn_pid==undefined) { content_type_header(); }
}
//We're from fidonet, need a header.
else { content_type_header(); }
}
}
function content_type_header()
{
/* No content-type specified, so assume IBM code-page 437 (full ex-ASCII)
*/
writeln("Content-Type: text/plain; charset=IBM437");
writeln("Content-Transfer-Encoding: 8bit");
}
Do you think I need to add any other checks?
~Ash-Fox
---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net