Why does Windows use CR LF?

后端 未结 6 822
不知归路
不知归路 2020-12-04 23:05

I understand the difference between the two so there\'s no need to go into that, but I\'m just wondering what the reasoning is behind why Windows uses both CR and LF to indi

6条回答
  •  猫巷女王i
    2020-12-04 23:30

    It comes from the teletype machines (and typewriters) from the days of yore.

    It used to be that when you were done typing a line, you had to move the typewriter's carriage (which held the paper and slid to the left as you typed) back to the start of the line (CR). You then had to advance the paper down a line (LF) to move to the next line.

    There are cases you might not have wanted to linefeed when returning the carriage, such as if you were going to strikethrough a character with a dash (you'd just overwrite it).

    But basically, it boils down to convention. DOS used the full CR/LF convention, and UNIX shortened it a bit. Now we're stuck!

提交回复
热议问题