Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "Line endings must be a Carriage Return/Line Feed (CRLF) pair" mean?

Tags:

icalendar

I used http://icalvalid.cloudapp.net/Default.aspx link to validate the link of my calendar. And i got the warning "Line endings must be a Carriage Return/Line Feed (CRLF) pair.". What does this mean? What do I need to this to remove this warning. Can anyone please help me on this issues. Your help will be appreciated. Thanks.

like image 254
rasth Avatar asked Apr 05 '11 12:04

rasth


People also ask

What are CRLF line endings?

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 carriage return line feed combination?

CR = Carriage Return ( \r , 0x0D in hexadecimal, 13 in decimal) — moves the cursor to the beginning of the line without advancing to the next line. LF = Line Feed ( \n , 0x0A in hexadecimal, 10 in decimal) — moves the cursor down to the next line without returning to the beginning of the line.

Does Windows use LF or CRLF?

Windows uses CRLF because DOS used CRLF because CP/M used CRLF because history. Mac OS used CR for years until OS X switched to LF. Unix used just a single LF over CRLF and has since the beginning, likely because systems like Multics started using just LF around 1965.

Why do we use CRLF?

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).


2 Answers

It means the file has to be in "Windows" format, rather than UNIX format. If you're creating the file from code, it means that you need to write "\r\n" at the end of the lines, rather than just "\n" -- assuming you're using some language where that makes sense, of course. If you're creating the file by hand, save it in "DOS mode" from your editor.

like image 141
Ernest Friedman-Hill Avatar answered Oct 03 '22 15:10

Ernest Friedman-Hill


It seems you are running a Linux or Mac OS X box, which uses just the LF (line feed) ASCII value for line endings.

Windows uses CRLF (carriage return; line feed) for line endings.

You must convert this, for example with Notepad++ (though dedicated application exist).

like image 25
orlp Avatar answered Oct 03 '22 15:10

orlp