M
Marvin Grill
Hi, I'm working on a type of NewsHound program and am stuck on how to
decode the yEnc encoded articles (body).
I tried using Joe Feser's yEnc class but can't seem to get it to work
properly
Not sure whether it's an Encoding.Type problem or not getting the
stream start position right.
In any case here's part of the code with the problem:
_________________________________________________________________
Article = 21971499;
nntp1.Send("BODY " + Article.ToString() + "\r\n");
// this line reads stream till line with period only
s = nntp1.Receive(".\r\n");
Stream inMemStream, outMemStream;
inMemStream= new MemoryStream(Encoding.UTF8.GetBytes(s));
outMemStream= new MemoryStream();
inMemStream.Seek(0, 0);
yenc.DecodeFromRawStream(inMemStream, outMemStream);
outMemStream.Seek(0, 0);
StreamReader sr = new StreamReader(outMemStream, Encoding.UTF8);
string ArticleAttachment = sr.ReadToEnd();
______________________________________________________________________
The problem is that the decoded string has only the upper case letters
right but the lower case letters are spaces.
If any one knows of any other components out there that can decode
yEnc please let me know.
Thanks
Marv
decode the yEnc encoded articles (body).
I tried using Joe Feser's yEnc class but can't seem to get it to work
properly
Not sure whether it's an Encoding.Type problem or not getting the
stream start position right.
In any case here's part of the code with the problem:
_________________________________________________________________
Article = 21971499;
nntp1.Send("BODY " + Article.ToString() + "\r\n");
// this line reads stream till line with period only
s = nntp1.Receive(".\r\n");
Stream inMemStream, outMemStream;
inMemStream= new MemoryStream(Encoding.UTF8.GetBytes(s));
outMemStream= new MemoryStream();
inMemStream.Seek(0, 0);
yenc.DecodeFromRawStream(inMemStream, outMemStream);
outMemStream.Seek(0, 0);
StreamReader sr = new StreamReader(outMemStream, Encoding.UTF8);
string ArticleAttachment = sr.ReadToEnd();
______________________________________________________________________
The problem is that the decoded string has only the upper case letters
right but the lower case letters are spaces.
If any one knows of any other components out there that can decode
yEnc please let me know.
Thanks
Marv