decoding algorithm
Status: Inactive
Brought to you by:
lucvdv
I've been trying to implement the b-news decoding algorithm in
Java recently and I believe I did everything right, though I don't
get the wanted results.
This is what I do :
* skip the header (and the newline char)
* read block (41 chars)
* decrease ascii value of chars in block with 0x20
* change base (I made a method that prints the decimal value of
a string given a certain base. When I print the encoded block
using base 224 it matches the value of the decoded block using
base 256 so the problem shouldn't lie here).
* store data in decoded block (40 chars)
If I'm missing something here, i would be greatfull if anyone
would inform me of it :)
ps: ik spreek ook nederlands :p
Logged In: YES
user_id=143782
What I'm missing in your explanation:
1) After the headers and before the first block, there's a line
with the filename.
2) There's a newline (CR-LF as required by NNTP) every 6
blocks.
3) If the text you're getting is the raw message from the
server (not pre-processed by a newsreader), there will be an
extra period that has to be stripped off at the start of each
line that begins with a period (if the first character of a line is
a period, it has to be doubled to two periods when posting
and changed back to a single one when retrieving the
message from the server).