r*z 发帖数: 1679 | 1 Carriage Return and line feed?
一个回车一个换行。不是一个意思吗? | G***G 发帖数: 16778 | 2 carriage return is character (0d) (\r).
line feed is character (0a) (\n)
Unix uses line feed as a new line character. Mac uses carriage
return as a new line character. The popular windows uses both instead.
In English, carriage return is used to return carriage.
line feed is used to feed a line.
【在 r*z 的大作中提到】 : Carriage Return and line feed? : 一个回车一个换行。不是一个意思吗?
| r*z 发帖数: 1679 | 3 sorry, i still don't get it.
A:
xxxx
xxxx
B:
xxx
a blank line
xxx
so A is carriage return, b is linefeed?
【在 G***G 的大作中提到】 : carriage return is character (0d) (\r). : line feed is character (0a) (\n) : Unix uses line feed as a new line character. Mac uses carriage : return as a new line character. The popular windows uses both instead. : In English, carriage return is used to return carriage. : line feed is used to feed a line.
| G***G 发帖数: 16778 | 4 The english's description is very simple, carriage return is to return
the carriage to the beginning place.
line feed is to move the paper to next line.
in Mac or unix, only one of the both can drive the two commands.
but in windows, you need two characters to drive the two commands.
【在 r*z 的大作中提到】 : sorry, i still don't get it. : A: : xxxx : xxxx : B: : xxx : a blank line : xxx : so A is carriage return, b is linefeed?
| O******e 发帖数: 734 | 5 Do you know how electronic typewriters and
dot-matrix printers work?
The "carriage return" moves the typeball or print
head to the left most position (beginning of line).
The "line feed" rolls the paper up by one line.
On electric typewriters used by humans, these two
actions are controlled by two different keys.
On electronic typewriters or dot-matrix printers
controlled by computers, these two actions are
driven by two different signals (characters).
Before there were word processing software
(e.g., Microsoft Word), you would save a document
in the simple text file format (what Windows calls
.txt files). At the end of each line of text,
the document editing software (like MS Notepad)
would automatically insert and save the invisible
line-breaking characters (whenever you press the
return/enter key). On Windows computers, both a
carriage return character and a line feed character
would be saved into the file. But on Unix and Mac
computers, it was considered redundant to save both
CR and LF characters, so only one character would
be saved and the other would be implied by default.
Unix and Mac computers ended up with opposite
conventions of which character to save and which
to default, so on Unix LF = CR+LF, and on Macs
CR = CR+LF.
【在 r*z 的大作中提到】 : sorry, i still don't get it. : A: : xxxx : xxxx : B: : xxx : a blank line : xxx : so A is carriage return, b is linefeed?
|
|