Textbox line endings on the web?
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?
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.
It's best to try to handle all of them. Even the '\r' from older Macs. And yes, it's determined by the client.
精彩评论