> From: [email protected] (Ludovic Courtès) > Cc: [email protected], [email protected] > Date: Tue, 18 Jun 2013 22:45:34 +0200 > > I think this patch solves the problem: > > diff --git a/libguile/rdelim.c b/libguile/rdelim.c > index 9d14967..9f16c69 100644 > --- a/libguile/rdelim.c > +++ b/libguile/rdelim.c > @@ -154,6 +154,7 @@ SCM_DEFINE (scm_read_line, "%read-line", 0, 1, 0, > { > case EOF: > case '\n': > + case '\r': > delim = buf[index]; > break; > > Probably the extra case should be #ifdef __MINGW32__, to make sure it > has no effect on non-Windows users. Thoughts?
Not a good idea, IMO: it will remove lone CR characters as well. > > I think the solution is to attach to the output port a transcoder that > > leaves the single newline character at end of line intact. But I > > couldn't find any example or documentation that would show me how to > > construct a transcoder for an encoding. make-transcoder wants a > > codec, but I see no documentation how to make one. IOW, how do I take > > a string like "iso-8859-15" and make a codec out of it? I trust that > > you will know, though ;-) > > Ah ah, this is an R6RS API that’s not actually fully implemented. > > So, there are predefined codecs, like ‘latin-1-codec’. This part is > implemented, in terms of ‘set-port-encoding!’. > > However the CR/LF transcoders are not implemented. Too bad. The text/binary I/O issue on Windows is not really reliable without that.
