Subject: EOL Conversion for Mac Users (forward)

From: Rupert Zhu <[email-masked]>
Date: Sat, 4 Jan 1992 14:04:50 -0500

The following message tells us what's going on with Mac machines and how
to make an easy conversion to solve the end-of-line problem.  Thanks
to Huangxin Wang for the knowledgeable advice.         --- Rupert Zhu

--------------------- Start of Forwarded Message ------------------------

From: [email-masked] ( Huangxin Wang)
To: rzhu@watmath
Subject: Re:  Standardization --- end-of-line problem with MAC

Hi, Rupert,

	Sorry I didn't reply your question earlier.  I use Mac all the time,
and it reads files created on PC or UNIX without any problem.  The problem
occurs only when I edit file on Mac and send it to other users on PC or
UNIX.  I think I have an idea and solution what's going on:

(1)  text file created on Mac end line with a single <CR>;

(2)  Mac has no problem reading text file with end-of-line sign as <CR> or
<LF> or <CR><LF>;

(3)  If one upload the text file created on Mac to UNIX in text mode, then
<CR> will be changed to <LF>;  If the upload is in binary mode, <CR> is not
changed thus it will cause problem on UNIX;

(4)  Similar thing happens at download:  in text mode:  <LF>-><CR>,
thus PC's <CR><LF> become <CR><CR> (that's why at one time I complaint
about double <CR> in the HXWZ files), but in binary mode, everything is
unchanged, <CR><LF> is shown up the same as a <CR>, but <LF> won't
messed up the two byte Chinese code (since Mac's script system can
recognize the beginning and ending of a script, thus allow the mixing
of single byte and multiple byte language text freely)

The solution for the Mac users is:

(1)  Downloading:  for all text GB file I got by uudecode the mail, I wrote
a small c program to check whether it end with <CR><LF> or <LF> (supposedly
I would never receive any file with a single <CR> since the transmission
already taking care of this); then I decide whether to download it in text mode
(<LF>) or binary mode (<CR><LF>);

(2)  Uploading a text file created on Mac:  Always use text mode in
transmission; then filter the file through your "addcr" program to make it
<CR><LF>.

I guess some people have problem with single <LF> file is some Chinese viewer
or word processor assume that all characters are double-byte, thus when a
single byte <LF> comes up, it screw up the following Chinese text.  Obviously
this is a very bad assumption.

Regards

Huangxin Wang

------------------------- End of Forwarded Message -----------------------