read-line and CRLF

Per Bothner per@bothner.com
Tue Jun 6 13:24:00 GMT 2000


brlewis@alum.mit.edu writes:

> I'm doing some SMTP, which defines EOL markers as CRLF.  When I use
> Kawa's read-line procedure, I get blank lines between each line,
> presumably because it first reads up to the \r and next time up to the
> \n.  Is this fixable?

Hm.  There already is code in kawa/standard/read_line.java to
handle CRLF.  If it doesn't could you try to debug it?

There is also code in gnu/text/LineBufferedReader.java to
handle CRLF, but you may need to call setConvertCR(true) first.

The difference is that if setConvertCR(true) is called, then
CRLF (or CR not followed by LF) gets converted to LF, at the
character level.  However, read-line is supposed to convert
CRLf to LF whether or not setConvertCR(true) has been called,
so if it doesn't work, it would be great if you could figure out why.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


More information about the Kawa mailing list