windows下默认的换行符号是CRLF
, Linux和Mac通用的是LF
。我在windows下将编辑器的换行模式修改为LF
,不知道会带来什么潜在问题?
另外也想看看大家怎么处理不同系统之间的换行符问题?
过去多啦不再A梦2017-05-02 09:24:00
Let me correct you first: Windows is CRLF
,Linux 是 LF
,Mac 是 CR
What to use? In fact, it doesn’t matter much. As long as the text editor supports it, you can use any line ending mark - of course "Notepad" does not support it. If you use Notepad to open a file with LF
as the end character, it will There are no branches.
In addition, like Git, Windows will by default convert CRLF to LF when submitting the code before submitting it. When updating the code, it will also convert LF to CRLF to achieve system compatibility.
Of course, there is another problem that you may need to pay attention to when developing read/write (note not just reading) text files.