[DGD] Telnet Protocol

Noah Gibbs noah_gibbs at yahoo.com
Fri Nov 21 01:14:18 CET 2003


--- Steve Foley <zeppo1 at mindspring.com> wrote:
> Obviously \r\n, \r\0, but what about just \r?  Or
> just \n?  Or \n\r?  Should
> \n\r be treated the same as \r\n?
> 
> My own inclination is that the answer to all those
> might be yes.  Thoughts?

  I'd say not just \r, because that's frequently used
for weird little animation things like status bars. 
You can print the bar, send a \r, print, send \r, and
repeat.  So that should do the carriage return without
the newline.

  I'm not sure whether to treat \n\r the same as \r\n.
 My immediate answer would be "yes", because if you
treat them as having individual effect, the two
together do the same thing.  The \n takes you downward
by one line, not necessarily affecting the horizontal
location in the line.  The \r returns you to the far
left edge of the line, but doesn't change what line
you're on.

  My understanding was that you couldn't just sent
Unix-style \n line endings to telnet, and that you
always needed to be careful to double them up to \r\n
just in case you had to deal with a DOS-style client.

  I believe the vast majority of text sent across the
'net does this.  However, I'm pretty sure some doesn't
work that way, because PUTTY (my Windows-based telnet
client) has a specific option for dealing with \n-only
text.  But in general, doubling the line endings up is
safer when sending, and accepting either \n or \n\r is
safer when receiving.  Just \r, though, shouldn't act
like just \n.


=====
------
noah_gibbs at yahoo.com

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list