Re: Backslash n [OT] was Line Separator and Paragraph Separator

From: Frank da Cruz (fdc@columbia.edu)
Date: Wed Oct 22 2003 - 13:50:27 CST


"Jonathan Coxhead" <jonathan@doves.demon.co.uk> wrote:
> On 22 Oct 2003, at 6:53, John Cowan wrote:
> > Kent Karlsson scripsit:
> >
> > > Don't know about <LF, CR>. I think that should be two line ends.
> >
> > I agree. I don't know any system that uses this sequence.
>
> The BBC Micro---well-known to a generation of British schoolchildren---used
> this sequence. You can probably find files in that encoding on some 5.25in
> floppies in DFS format in some store cupboards somewhere (for what that's
> worth).
>
Also the PRIME computers of the 1970s and 80s. If you remember an online
service called The Source (similar to Compuserve, but different), it ran on
big PRIMEs. File transfer protocols (such as Kermit) that were used to get
text files into and out of The Source swapped LFCR to CRLF (and stripped the
8th bit from its native "negative ASCII" / "Mark parity" encoding).

LFCR makes historical sense if you think about how manual typewriters work.
When you push the "carriage return lever" (did you ever wonder where the
name Carriage Return came from?), the platen rolls up one line immediately
(LF), and then as you keep pushing it, the carriage returns to the left
margin (CR). See:

  http://xavier.xu.edu:8000/~polt/tw-parts.html

(hey, I never saw a left-handed typewriter before...)

> I wrote a little line-conversion (f)utility recently, and the (minimal)
> research I did suggested that the following was a complete set of line-
> terminators that might be found in practice:
>
You can't really tell by inspection what any of these sequences is supposed
to do, without knowing where and how the file was created. Is CR a line
terminator, or a paragraph separator, or is it being used for overstriking
(a common method of underlining).

Treating EOF as EOL is dangerous. In Unix, many applications flag an error
when a text file does not end with a line terminator, since it might mean
the file is incomplete. This is in contrast to the Windows practice of
auto-detecting-and-correcting-and-accepting everything, on the assumption
that users can't possibly know what they are doing.

Another interesting scheme is used in VMS text files of a certain format:
each line begins with LF and ends with CR.

- Frank



This archive was generated by hypermail 2.1.5 : Thu Jan 18 2007 - 15:54:24 CST