Return symbol: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
換行符號 (Return symbol, line terminators) | 換行符號 (Return symbol, line terminators, line endings, newline, end of line (EOL), line feed, or line break) | ||
* On {{Win}}: {{kbd | key=<nowiki>CRLF</nowiki>}} = {{kbd | key=<nowiki>\r\n</nowiki>}} | * On {{Win}}: {{kbd | key=<nowiki>CRLF</nowiki>}} = {{kbd | key=<nowiki>\r\n</nowiki>}} | ||
* On {{Linux}} & {{Mac}}: {{kbd | key=<nowiki>LF</nowiki>}} = {{kbd | key=<nowiki>\n</nowiki>}} | * On Unix, {{Linux}} & recent versions of {{Mac}}: {{kbd | key=<nowiki>LF</nowiki>}} = {{kbd | key=<nowiki>\n</nowiki>}} | ||
* On classic versions of {{Mac}}<ref>[https://en.wikipedia.org/wiki/Classic_Mac_OS Classic Mac OS - Wikipedia]</ref><ref>[https://en.wikipedia.org/wiki/Newline Newline - Wikipedia]</ref> e.g. Mac OS 9: {{kbd | key=<nowiki>CR</nowiki>}} = {{kbd | key=<nowiki>\r</nowiki>}} | |||
== 如何看到換行符號 == | == 如何看到換行符號 == | ||
查看每一行使用的換行符號 | |||
* [https://notepad-plus-plus.org/zh/ Notepad++] On {{Win}} 選單: 檢視: 特殊字元: 顯示行尾字元 (EOL) | * [https://notepad-plus-plus.org/zh/ Notepad++] On {{Win}} 選單: 檢視: 特殊字元: 顯示行尾字元 (EOL) | ||
查看檔案使用的換行符號 | |||
* [https://en.wikipedia.org/wiki/File_(command) file (command)]: {{kbd | key=<nowiki>file filename.txt</nowiki>}} on {{Linux}}, {{Mac}}<ref>[https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/file.1.html file(1) Mac OS X Manual Page]</ref> & Cygwin on {{Win}} | * [https://en.wikipedia.org/wiki/File_(command) file (command)]: {{kbd | key=<nowiki>file filename.txt</nowiki>}} on {{Linux}}, {{Mac}}<ref>[https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/file.1.html file(1) Mac OS X Manual Page]</ref> & Cygwin on {{Win}} | ||
| Line 53: | Line 57: | ||
== Related articles == | == Related articles == | ||
* [https://en.wikipedia.org/wiki/Carriage_return Carriage return - Wikipedia] | * [https://en.wikipedia.org/wiki/Carriage_return Carriage return - Wikipedia] | ||
* [https://zh.wikipedia.org/zh-tw/%E6%8F%9B%E8%A1%8C 換行 - 维基百科,自由的百科全书] | |||
* [https://zh.wikipedia.org/wiki/%E5%9B%9E%E8%BB%8A%E9%8D%B5 回車鍵 - 維基百科,自由的百科全書] | * [https://zh.wikipedia.org/wiki/%E5%9B%9E%E8%BB%8A%E9%8D%B5 回車鍵 - 維基百科,自由的百科全書] | ||
* [http://violin-tao.blogspot.tw/2016/05/crlflf-bug.html 陳雲濤的部落格: 筆記 CRLF跟LF之區別 --- 隱形的 bug]:「CRLF才是真正的打字機運作方式,你可以想像:打字機打到最右邊,要先return到最左邊之後,再往下一行,所以是CRLF ... ...」 | * [http://violin-tao.blogspot.tw/2016/05/crlflf-bug.html 陳雲濤的部落格: 筆記 CRLF跟LF之區別 --- 隱形的 bug]:「CRLF才是真正的打字機運作方式,你可以想像:打字機打到最右邊,要先return到最左邊之後,再往下一行,所以是CRLF ... ...」 | ||
Revision as of 08:22, 5 April 2018
換行符號 (Return symbol, line terminators, line endings, newline, end of line (EOL), line feed, or line break)
- On Win
: CRLF = \r\n - On Unix, Linux
& recent versions of macOS
: LF = \n - On classic versions of macOS
[1][2] e.g. Mac OS 9: CR = \r
如何看到換行符號
查看每一行使用的換行符號
- Notepad++ On Win
選單: 檢視: 特殊字元: 顯示行尾字元 (EOL)
查看檔案使用的換行符號
- file (command): file filename.txt on Linux
, macOS
[3] & Cygwin on Win
| 檔案內容 | File command 偵測結果 |
|---|---|
| 換行符號是 CRLF = \r\n | UTF-8 Unicode text, with CRLF line terminators |
| 換行符號是 LF = \n | UTF-8 Unicode text |
| 換行符號是 CR = \r | UTF-8 Unicode text, with CR line terminators |
| 換行符號夾雜 \r\n 和 \r | UTF-8 Unicode text, with CRLF, CR line terminators |
| 換行符號夾雜 \r\n 和 \n | UTF-8 Unicode text, with CRLF, LF line terminators |
| 換行符號夾雜 \n 和 \r | UTF-8 Unicode text, with CR, LF line terminators |
| 無內容的空檔案 | empty |
Related articles
- Carriage return - Wikipedia
- 換行 - 维基百科,自由的百科全书
- 回車鍵 - 維基百科,自由的百科全書
- 陳雲濤的部落格: 筆記 CRLF跟LF之區別 --- 隱形的 bug:「CRLF才是真正的打字機運作方式,你可以想像:打字機打到最右邊,要先return到最左邊之後,再往下一行,所以是CRLF ... ...」
- Differences in end of line characters Mac, Windows, and Linux
References