By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

Unicode Control Characters

P: n/a
Hi

Most example code I've seen uses the code "\n" to perform a CRLF, and this seems to work fine in most instances, although I've just tried to issue it over a TcpClient and it appears to just perform a LF. Is there another control char for CR

If not, what's the best way to issue a CRLF over a TcpClient, without having to use a seperate WriteLine method for each line

Thanks
Jennifer
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Jennifer wrote:
Hi,

Most example code I've seen uses the code "\n" to perform a CRLF, and
this seems to work fine in most instances, although I've just tried
to issue it over a TcpClient and it appears to just perform a LF. Is
there another control char for CR?

If not, what's the best way to issue a CRLF over a TcpClient, without
having to use a seperate WriteLine method for each line.

Thanks,
Jennifer


Environment.NewLine

- pete
Nov 15 '05 #2

P: n/a
AirPete wrote:
Jennifer wrote:
Hi,

Most example code I've seen uses the code "\n" to perform a CRLF, and
this seems to work fine in most instances, although I've just tried
to issue it over a TcpClient and it appears to just perform a LF. Is
there another control char for CR?

If not, what's the best way to issue a CRLF over a TcpClient, without
having to use a seperate WriteLine method for each line.

Thanks,
Jennifer


Environment.NewLine

- pete


Also, I *think* '\r' is the character for a CR, but using
Environment.NewLine is much more portable, and nicer looking.

- Pete
Nov 15 '05 #3

P: n/a
AirPete <x@x.x> wrote:
Also, I *think* '\r' is the character for a CR, but using
Environment.NewLine is much more portable, and nicer looking.


You shouldn't blindly use Environment.NewLine though - particularly not
over sockets, where usually the protocol is well-defined.

Environment.NewLine gives the usual new line string to use for files on
the current system. That's *not* what's usually wanted over a network
connection.

\r is always carriage return
\n is always linefeed

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.