|
CRLF is a sequence of control characters consisting of a carriage return (CR) and a line feed (LF). The CRLF sequence is the newline separator for text files in Microsoft Windows and related operating systems. It is also the standard line separator for most Internet protocols. In computing, a control character or non-printing character, is a code point (a number) in a character set that does not, in itself, represent a written symbol. ...
Originally, carriage return was the term for the key, lever, or mechanism on a typewriter that would cause the cylinder on which the paper was held (the carriage) to return to the left after a line of text had been typed, and would often move it down a line as...
In computing, line feed (LF) is a control character indicating that one line should be fed out. ...
In computing, a newline is a special character or sequence of characters indicating the end of a line. ...
Computer files can be divided into two broad categories: binary and text. ...
Microsoft Windows is a range of closed source proprietary commercial operating environments for personal computers and servers. ...
Operating system differences
The use of the CRLF causes portability problems when trying to move text files between Windows, Unix, and Macintosh computers : UNIX is a portable, multi-tasking and multi-user computer operating system originally developed by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. ...
Macintosh, also known as Mac for short, is a family of personal computers manufactured by Apple Computer, Inc. ...
- Windows uses the CRLF;
- Unix and Mac OS X use only LF;
- and the Macintosh before Mac OS X uses only CR.
Mac OS X is the latest version of the Mac OS, the operating system software for Macintosh computers. ...
Recognising and fixing incompatibilities - When a Unix or Macintosh text file is displayed on a Windows machine, it appears as one long line with strange characters where the line breaks should be, often appearing as black rectangles
- When a Windows text file is displayed on a Unix or Mac OS X machine, every line appears to end with a superfluous CR, which often appears as ^M
- When a Windows text file is displayed on a pre-Mac OS X Macintosh, every line appears to begin with a superfluous LF.
Some software will automatically compensate for incompatible line endings, but other software will not. When dealing with text files that are not in the correct format for your operating system, it helps to have a program that can correct them. For example, Notepad, the standard plain text editor pre-installed on all Windows machines does not automatically convert Unix or Macintosh text files, but the DOS edit command (also pre-installed on all Windows machines) does convert Unix or Macintosh style CR line endings and allows to re-save the file with Windows-style CRLF line endings. Notepad can be used to edit unformatted text. ...
History It has been speculated that QDOS (which Microsoft purchased and renamed MS-DOS) adopted CR+LF to indicate a newline to copy the implementation used by CP/M. Further speculation indicates that CP/M chose CR+LF to introduce a deliberate incompatibility with Unix to mitigate a possible lawsuit by AT&T/Bell over violating their Unix copyrights as CP/M was loosely modeled on Unix. Another plausible theory is that, since early personal computers were severely memory constrained, developers had to write software that occupied the minimum number of bytes of memory. Using a CR followed by an LF in the standard text file format allowed a much simpler (and smaller) loop to output characters to the TTY and early CRT devices of the day. Unfortunately, this complicates how software manipulates text. QDOS, the Quick and Dirty Operating System, (not to be confused with Sinclairs QDOS for the Sinclair QL computer, which shared the same name) was a simple 16-bit operating system originally written in just four months by Tim Paterson in 1980 for an Intel 8086-based computer kit...
CP/M (whose antecedent was most commonly accepted during the 1970s as Control Program for Microcomputers but also Control Program/Monitor or Command Processor for Microcomputers are purported as well) was an operating system for Intel 8080/85 and Zilog Z80 based microcomputers. ...
See also - ASCII
- Text editor
- tofrodos (http://www.thefreecountry.com/tofrodos/index.shtml) is a program for Unix and Windows to convert between these formats
|