Difference between CR LF, LF and CR line break types?

前端 未结 9 2185
春和景丽
春和景丽 2020-11-22 04:05

I\'d like to know the difference (with examples if possible) between CR LF (Windows), LF (Unix) and CR (Macintosh) line break types.

9条回答
  •  名媛妹妹
    2020-11-22 04:16

    Since there's no answer stating just this, summarized succinctly:

    Carriage Return (MAC pre-OSX)

    • CR
    • \r
    • ASCII code 13

    Line Feed (Linux, MAC OSX)

    • LF
    • \n
    • ASCII code 10

    Carriage Return and Line Feed (Windows)

    • CRLF
    • \r\n
    • ASCII code 13 and then ASCII code 10

    If you see ASCII code in a strange format, they are merely the number 13 and 10 in a different radix/base, usually base 8 (octal) or base 16 (hexadecimal).

    http://www.bluesock.org/~willg/dev/ascii.html

提交回复
热议问题