views:

55

answers:

2

I have an ASP.Net page with a multi-line textbox on it.

Will the line endings on this textbox be according to the server or the client? What I'm asking is if ASP.Net is running in Linux on Mono will the line endings always be \n or will it depend on if the client computer is running Linux?

Are line endings in a textbox determined by the server or client?

+1  A: 

By the client. Jeff just posted a pretty useful blog entry about this.

As Jeff pointed out in his article the line endings are actually determined by the source of the content. So you could actually copy and paste content from different sources and end up with certain lines terminated \n and others with \r or \r\n, all in the same textbox.

Chris Pebble
This is what I figured, I wasn't for sure if apache/asp.net normalized them or not though
Earlz
+1  A: 

It's best to try to handle all of them. Even the '\r' from older Macs. And yes, it's determined by the client.

naivists