
694
|
Chapter 12: Web and Print Publishing
Line-termination conventionsTable 12-1.
Line termination Encoding OSes
Line feed
c
1 ( or ) Unix and Mac OS X
d
Also expressed as CR.a.
Also expressed as CR + LF or CR + NL (b. New Line).
Also expressed as LF or NL.c.
Some aspects of Mac OS X, such as working in the d. Terminal application, prefer this line-termination convention.
A nonbinary le transfer session will convert the line-termination characters appropri-
ately. For example, if you are using Windows and connect to a Linux or Unix server to
transfer a le from Linux or Unix to Windows, a nonbinary FTP connection will change
line termination appropriately, from LF to CR+LF. For those who use Unix, or for Mac
OS X using the Ter mina l application, the following tr command changes line termination,
from carriage returns (CR) to line feeds (LF):
tr '\015' '\012'
And, when transferring les that were authored on Windows to Unix or Linux, the fol-
lowing tr command performs a similar function by simply removing the carriage returns
(CR):
tr -d '\015'
Files that contain real binary data must be transferred in binary transfer mode; other-
wise, their data will most certainly become corrupt. Compressed les are the most com-
monly encountered binary les. Binary data, for example, may contain byte values that
correspond to carriage-return or line-feed characters, but they are not to ...