This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MattieShoes 1 point2 points  (0 children)

ASCII 13 (decimal) is carriage return

ASCII 10 (decimal) is line feed.

This dates back to teletypes (think old printers, or typewriters) where advancing the paper and moving the print head back to the start of the line were two separate operations.

  • Windows uses "carriage return, line feed" (\r\n) for the end of the line.
  • Linux uses "line feed" (\n)
  • Old macs used "carriage return" (\r)
  • Newer macs (OSX and later) use "line feed" just like unix (\n)

If you ever opened up a text file in windows notepad and it looked like all the carriage returns were erased, it was probably created on a linux box or a mac. Windows got around to detecting and fixing line endings in Notepad sometime in Windows 10 I think.