[gopher] Line terminators in Gopher transactions

Alistair alistair at alistairsserver.no-ip.org
Tue May 22 09:17:38 UTC 2012


On 22/05/2012 04:21, Kim Holviala wrote:
> On Tue, 22 May 2012, 05:49:55 EEST, Kim Holviala<kim at holviala.com>  wrote:
>
>> Traditionally all TCP protocols have used CRLF as the line ending. Major
>> pain in the ass for both clients and servers, but such is life.
>
> The CRLF comes from the original printer meaning of those two ASCII codes: Carriage Return and Line Feed. If you wanted to be at the start of the next line, you needed both.

Indeed, this is one of those rare times where windows gets something 
right over unix - using LF on its own is a shorthand for CRLF. Since 
there's no control code for "CR+LF" in ASCII you should send both.

I can't really see how saving one byte per line is worth all the extra 
confusion but this is the system history has burdened us with so we just 
have to manage :)

Line ending detection/correction is trivial to add to a client anyway so 
it's just something you have to take into account.



More information about the Gopher-Project mailing list