Re: [X-Unix] Why didn't Apple change the line break ?

William H. Magill magill at mcgillsociety.org
Mon Sep 20 16:19:49 PDT 2004


On 20 Sep, 2004, at 14:58, Brent Baisley wrote:
> Unix standard is just a line break, Mac standard is  just a carriage 
> return. Changing it to Unix standard probably would have broken all 
> text interfaces in all programs on the Mac since they wouldn't know 
> where a line ended. Windows uses both line feeds and carriage returns. 
> So if anything, Apple should have change to Windows standard as sort 
> of a transition.
> For web stuff, I find if I code to Unix standard I'm pretty safe. 
> Probably because the web was originally based in Unix/Mainframe, so 
> most Mac programs used for the web would recognize how a line ends.
>
> Both the terms line feed and carriage return are kind of antiquated. 
> Derived from the type writer. A line feed "scrolled" the paper to the 
> next line, but left you in the same spot vertically. A "carriage 
> return" returned the "carriage" back to the left. So if you think 
> about it, Windows is the only platform that got it right using both a 
> carriage return and line feed. When you press return you are brought 
> to the start of the next line. Then there is the vertical tab, which 
> FileMaker using as a return within the database. Go figure.
>
> On Sep 20, 2004, at 2:44 PM, Alexandre Quessy wrote:
>> I am a web developer, and I am having problems with charcter 
>> encoding, and especially line breaks on Mac OS X. I wonder why Apple 
>> didn't change the line break to the UNIX standard instead of keeping 
>> the same old one. Anyone have an idea ?
>>
>> Character encodings are common and universal (ISO-8859-1 and UTF-8, 
>> mainly for me) but line break aren't. Why not switch ?

This issue has been around since the beginning of "interactive" 
computing -- the IBM world (long before Microsoft, used the "newline" 
which was a composite character that did BOTH a carriage-return and a 
linefeed. Most common usage -- the good ol' 2741, aka IBM Selectric.
Which also harkens up some the TTY heritage of interactive usage.

As far as the Mac and OS X is concerned, the issue is actually one 
dependent upon your choice of editor.

The "most rational" of the command line editors -- emacs -- doesn't 
care. It will read either and switch to that "mode" or you can convert 
from one to the other. If you want a GUI editor that does the same 
thing, use BBedit. Even Apple's TextEdit can deal with the two by 
changing preferences to "plain text." (RTF documents are 100% 
incompatible with Unix by definition. Their formating information is 
simply NOT "plain text.")

The only time that the difference between Line-Feed and Carriage-Return 
becomes an issues is when you are using one of the command line display 
command -- cat. When used on a Carriage-Return file. (I think both 
"more" and "less" also do the conversion for you, but I don't have a 
file handy to test.)

T.T.F.N.
William H. Magill
# Beige G3 - Rev A motherboard - 768 Meg
# Flat-panel iMac (2.1) 800MHz - Super Drive - 768 Meg
# PWS433a [Alpha 21164 Rev 7.2 (EV56)- 64 Meg]- Tru64 5.1a
# XP1000  [Alpha EV6]
magill at mcgillsociety.org
magill at acm.org
magill at mac.com
whmagill at gmail.com





More information about the X-Unix mailing list