The correct way to end the line

From: Gary Barnett (gbarnett@POLARNET.COM)
Date: 08/29/97


On Fri, 29 Aug 1997 14:42:24 -0600
Rob Baumstark <shirak@CONNECT.AB.CA> wrote:

<snip>
> On another topic...., talking about \r's and \n's, i encountered them once
> on a small DOS program i was writing, and it should make no difference what
> order you put them in, though \n\r does kinda make more sence (in my head)
>   \r is carrage return, and puts the cursor at the beginning of the line
> you are currently on, but does not go to the next line
>   \n is next line, it puts you on the next line, right below where you
> were, it does not go back to the beginning of the line.
> If you are familiar with DOS or Win text editors, \r would be like hitting
> the "home" key, and \n would be like hitting the down arrow (and creating a
> line there)
> I think it makes more sence to make a new line, then go to the beginning of
> it, but it's up to you
>
The correct syntax (references follow) IS: \r\n
\r = carrage return (CR)  \n = line feed (LF)

RFC References:

>From RFC 1184:       (relevant to line mode.. the mode Circle uses)

5.3 Output processing

   Regardless of what mode has been negotiated, the server side is
   responsible for doing all output processing.  Specifically, it should
   send "CR LF" when it wants the "newline" function, "CR NUL" when it
   wants just a carriage return, and "LF" when it wants just a linefeed.


Zmud reference  http://www.zuggsoft.com/zmud/version.htm
4.55 13-Apr-97 Fixed extra line problems on MUDs that violate telnet protocol standards

I couldn't find the relevant page, but I remember he went on a bit of
tirade once upon a time about some muds using \n , some using \r and
some using \n\r ..

In the case of the problems reported with the TUSH mud client.. the mud
client is broken and should be fixed. If everyone used the correct
standards then the author of that program probably wouldn't have made
the mistake in the first place...or been forced to violate the standards
to get his/her client working on his/her favorite mud.

Again.. you _must_  use \r\n to be correct with standards, unless you are
negotiating differently via the telnet options with the client. The fact
that some clients/telnet apps allow you to violate the standards doesn't
mean it's an acceptable practice.

--Mallory
----
I have discovered the secret of happiness -- It is work, either with the
hands or the head. The moment I have something to do, the draughts are
open, the chimney draws, and I am happy. -- John Burroughs


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST