Speaking specifically about text areas in web forms, for all text areas, on all platforms, \r\n will work.
If you use anything else, you will cause problems with cut and paste on Windows platforms.
Line breaks will be canonized by window browsers when submitting the form, but if you submit the form to the browser using \n linebreaks, you will find that the text will not be copied and pasted correctly, for example, in notepad and text field.
Interestingly, although the Unix end-of-line agreement has \n , the standard in most text-based network protocols, including HTTP, SMTP, POP3, IMAP, etc., is still \r\n . Yes, this may not make much sense, but this story and evolving standards are for you!
Ben Jan 08 '13 at 14:29 2013-01-08 14:29
source share