![]() The CR was necessary in order to get the teletype or video display to return to column one and the LF (today, NL, same code) was necessary to get it to advance to the next line. The brain-dead systems that required both CR and LF simply had no abstraction for record separators or line terminators. ![]() Applications built-in control characters and device-specific processing. Now, we take it for granted that anything we want to represent is in some way structured data and conforms to various abstractions that define lines, files, protocols, messages, markup, whatever.īut once upon a time this wasn't exactly true. The sad state of "record separators" or "line terminators" is a legacy of the dark ages of computing. Jeff Atwood has a blog post about this: The Great Newline Schism that allow the automatic detection of the file's end-of-line convention and to display it accordingly. Most modern text editors and text-oriented applications offer options/settings, etc. As time went by the physical semantics of the codes were not applicable, and as memory and floppy disk space were at a premium, some OS designers decided to only use one of the characters, they just didn't communicate very well with one another -) CR+LF was doing both, i.e., preparing to type a new line. LF moved the paper up (but kept the horizontal position identical) and CR brought back the "carriage" so that the next character typed would be at the leftmost position on the paper (but on the same line). As you indicated, Windows uses two characters the CR LF sequence Unix (and macOS starting with Mac OS X 10.0) only uses LF and the classic Mac OS (before 10.0) used CR.Īs indicated by Peter, CR = Carriage Return and LF = Line Feed, two expressions have their roots in the old typewriters / TTY. They are used to mark a line break in a text file. CR and LF are control characters, respectively coded 0x0D (13 decimal) and 0x0A (10 decimal).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |