1c7 / VideoList

:us: -> :cn: @糖醋陈皮 翻译的视频列表
https://weibo.com/2004104451
57 stars 11 forks source link

换行 #62

Open 1c7 opened 8 years ago

1c7 commented 8 years ago

LF = Line Feed CR = Carriage Return

这两个词来自以前电传打字机,打字机换行需要时间,而这段时间传输过来的字符将丢失。 所以想了个办法就是用特定字符告诉打字机换行 Carriage Return 代表把写头移动到最左边 Line Feed 代表去下一行

LF = \n CR = \r

Windows: '\r\n' Mac (OS 9-): '\r' Mac (OS 10+): '\n' Unix/Linux: '\n'



参考资料:

http://blog.csdn.net/xiaoxian8023/article/details/8448160 https://en.wikipedia.org/wiki/Newline#Representations http://stackoverflow.com/questions/426397/do-line-endings-differ-between-windows-and-linux https://en.wikipedia.org/wiki/Newline http://stackoverflow.com/questions/7013034/does-windows-carriage-return-r-n-consist-of-two-characters-or-one-character https://danielmiessler.com/study/crlf/