DWQA QuestionsCategory: Development ToolWhat's the problem with LF in windows?
leohxj asked 2 months ago

The default newline symbol in windows isCRLF, common to Linux and MACLF。 I changed the line feed mode of the editor toLF, I don’t know what potential problems will arise?
Also want to see you how to deal with different systems between the line break problem?

1 Answers
Best Answer
Border town answered 2 months ago

One thing to correct: windows isCRLFLinux isLFMac isCR
In fact, it’s not a big problem. As long as the text editor supports it, it’s OK to use any line end tag — of course, Notepad is not supported. If you open one with NotepadLFAs the end of the file, there will be no lines.
In addition, like git, under windows, by default, CRLF will be converted to LF when code is submitted and then submitted. When code is updated, lf will also be converted to CRLF to achieve system compatibility.
Of course, there is also a problem that you may need to pay attention to when developing read / write (note not just read) text files.

leohxj replied 2 months ago

Thank. But the correct line break for Mac is as follows: the line break before Mac OSX 10.9 isCR, later versions changed to be compatible with LinuxLF, see:Do line endings differ between Windows and Linux?