[Python-Dev] RE: [Pythonmac-SIG] Mac Python and line-endings

Peter H. Froehlich phf@acm.org
Tue, 18 Sep 2001 12:29:48 -0700


Hi there!

On Tuesday, September 18, 2001, at 12:42 , Chris Barker wrote:

> Nathan Heagy wrote:
>>
>>> Also, Java supports this, and the algorithm to support it is not
>>> difficult: to read a line, read until you see either \r or \n; if you
>>> see \r, peek one character ahead and if that's a \n, include it in the
>>> line.
>>
>> What about the mac where \r *is* the line ending?
>
> then it won't be a \n, so it won't be included.

I think the point is what to do if a file on the Mac includes the 
combination "\r\n" where the line should end at the "\r" but the "\n" 
should be returned as the next character or part of the next line...

Peter
(who thinks text files suck :-)
--
Peter H. Froehlich @ http://www.ics.uci.edu/~pfroehli/