Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!tymix!cirrusl!ss168!dhesi From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Newsgroups: comp.text.tex Subject: Re: Zoo file for msdos: change ``LF'' to ``CR'' for ascii files Message-ID: <3072@cirrusl.UUCP> Date: 19 Apr 91 18:39:13 GMT References: <70463@eerie.acsu.Buffalo.EDU> <3066@cirrusl.UUCP> <71539@eerie.acsu.Buffalo.EDU> <1991Apr18.204421.28260@sj.nec.com> Sender: news@cirrusl.UUCP Reply-To: Rahul Dhesi Lines: 32 In response to various suggestions for newline conversions such as: >>3) use WP5.1 ``convert'' to convert it from WP4.1 to WP5.1 and then to ASCII. ... >An additional method for the MS-DOS user to convert text files is to use >Vern Buerg's LIST program. In about 99% of cases various newline conversion methods will work. However, you will find that most newline conversion algorithms don't do it right. Most of them blindly add CR before each LF (or, in the other direction, blindly strip all occurrences of CR). This fails in some rare cases. -- A file may contain CR characters for underlining. These should not be stripped when going from MS-DOS to **IX. So, "CR LF" should be translated to LF, but "CR CR " should be left unchanged. -- A file may contain a sequence like "CR LF". When going from **IX to MS-DOS, this should remain unchanged, *not* translated into "CR CR LF", which will confuse MS-DOS programs. The above is one reason why zoo doesn't try to do newline conversions. It's hard to do it right. It's better to have a smart utility like "flip" always do it right, instead of doing it 99% right. I searched for a while for a good newline conversion program, and found none that was both portable and correct, before deciding that I had to write my own. -- Rahul Dhesi UUCP: oliveb!cirrusl!dhesi