Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the universal newline for all operating systems? (LF and CR)

When I write a file using Delphi it's on a Windows machine and the text files it puts out work fine on windows. When I use it on a Mac though it's expecting the formatting to be a bit different. On Mac the newline is different and it can't always read the Windows files.

How can I make my files readable by mac programs?

like image 996
Daisetsu Avatar asked Sep 15 '10 18:09

Daisetsu


People also ask

Is \n LF or CRLF?

Description. The term CRLF refers to Carriage Return (ASCII 13, \r ) Line Feed (ASCII 10, \n ). They're used to note the termination of a line, however, dealt with differently in today's popular Operating Systems.

What is CRLF characters?

The CRLF abbreviation refers to Carriage Return and Line Feed. CR and LF are special characters (ASCII 13 and 10 respectively, also referred to as \r\n) that are used to signify the End of Line (EOL).

Should I use LF or CRLF?

Whereas Windows follows the original convention of a carriage return plus a line feed ( CRLF ) for line endings, operating systems like Linux and Mac use only the line feed ( LF ) character. The history of these two control characters dates back to the era of the typewriter.

What do CR and LF mean?

(Carriage Return/Line Feed) Two characters that indicate the end-of-line (end-of-paragraph) in Windows and DOS. See line break.


1 Answers

  • For Windows, it is CRLF
  • For UNIX, it is LF
  • For MAC (up through version 9) it was CR
  • For MAC OS X, it is LF

The simple fact is that it is different for all operating systems. There is no "universal" newline. The best you can do is be aware of the differences.

like image 146
riwalk Avatar answered Oct 21 '22 01:10

riwalk