A couple of things to remember.
Standards matter. If the standard says order matters, then order matters.
IETF RFC 2608, and RFC 2616.
2.2 Basic rules
The following rules are used throughout this specification to
describe basic parsing constructs. The US-ASCII coded character set
is defined by ANSI X3.4-1986.
...
CR = <US-ASCII CR, carriage return (13)>
LF = <US-ASCII LF, linefeed (10)>
...
HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all protocol elements except the entity-body (see appendix 19.3 for tolerant applications).
- - - - -
In layman's terms, the HTTP protocol standard states you MUST use \r\n as the line terminator. This remains the case in the current RFC 7230 for HTTP.
CR = (13) = 0x0D
LF = (10) = 0x0A.
Mnemonic: "ReturN" = R before N.
0D0A = \r\n = CR,LF = carriage Return, liNe feed.
Now if your context isn't HTTP and you're really talking about the OS-dependent "Line Terminator" concept, then what you really want is to define the file/data format terminator in an OS-independent way, as HTTP did, or to explicitly embrace it and use your programming language native construct for the OS line terminator so you don't have to worry about it.
In any .NET language, it is Environment.NewLine.
In Java7 and beyond, it is System.lineSeparator().
In Java6 and below, it is System.getProperty("line.separator").
And in Perl, it is $/ (input record separator) and $\ (output record separator). It has distinct semantics for reads and writes, unlike other, lesser languages.
In Awk, it is the RS varable.
In Vim, it would be: :e ++ff=dos
The global option is :set ffs=dos,unix
The reason for the "CR before LF" is steeped in the history of typewriters and dot-matrix printers:
A reason for putting the line feed after the carriage return is that reduces the total amount of time required -- while the head is returning to the left edge of the paper, the platen can index one line. The longer operation starts first, so the whole operation completes in the time it takes the longer operation to execute.
See? Multitasking and parallel processing are just so last century.
Just because you didn't pay tuition doesn't mean you didn't get schooled.
Mike808/