[cl-irc-devel] external format guessing for incoming messages

Andreas Fuchs asf at boinkor.net
Wed Mar 8 18:20:46 UTC 2006


Hi,

the following patch is a proof-of-concept implementation of external
format guessing for incoming messages (and customizable external
formats for outgoing messages, defaulting conservatively to latin-1).

With that patch, cl-irc now opens a binary stream to the server, and
opens flexi-streams on top of that. The outgoing part is pretty
straightforward; the incoming part not so much (:

Reading works like this:

 * We read a line of latin-1 chars
 * We try to decode their code-chars (latin1 is a 1:1 translation to
   code-chars, and where it isn't, I hope flexistreams takes care of
   that (-:) using the list of external-formats in
   *default-incoming-external-formats*.
 * When we find a decoding that doesn't throw a error, we build a
   message from that.

Positive side effect: cl-irc should now work on windows because the
external format allows specification of eol convention. Negative side
effect: I didn't get parsing to work without #\Return, so this patch
appends a #\Return character to the raw message.

Which brings me to the todo list:

 * DCC connections probably don't work. I don't care about dcc, so I
   won't fix them (:
 * The parser should work without #\Return.
 * reading latin1 and decoding from the char codes is ... ugly. But
   it's probably less ugly than doing our own buffering. Maybe
   somebody wants to investigate that. (:

Here's the patch:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ,external-format-guessing.patch
Type: application/octet-stream
Size: 9213 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-irc-devel/attachments/20060308/30ea1c56/attachment.obj>
-------------- next part --------------

Cheers,
-- 
Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs


More information about the cl-irc-devel mailing list