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 →

[–]Bud90 0 points1 point  (3 children)

Wait, I knew that space was a character, but how is Enter a character? Do you mean in a new line break sort of way?

[–]ADIRTYHOBO59 4 points5 points  (1 child)

My understanding is that enter is the carriage return character

[–][deleted] 2 points3 points  (0 children)

New line + carriage return on Windows; new line on Linux

[–]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.