Karl von Laudermann wrote:

> 
> If you're using Mac OS X, rather than OS 9 or earlier, 

I am -10.4+

> then your text
> files should be using LF as a line break, not CR. 

I use both TextEdit and TextWrangler.   Both put in \r\n

> And ruby on the PC
> should be able to handle LF line endings just fine; you shouldn't need
> to convert line endings. 

Ruby does handle it fine.


> Any decent PC text editor shoud be able to
> handle LF as well (notepad.exe is *not* a decent text editor), 

Bingo.  I don't use a proper text editor.  I use Notepad.  And my PC 
clients use Notepad.  If I don't do this, anyone who does edit it later 
on a PC in Notepad gets a compressed file that will not subsequently run 
(all text is mashed together and a real long string).  If I didn't 
comment my code, and I always used a semi colon between clauses, it 
would not be an issue.

> and
> even if not, a proper line ending converter should just insert a CR
> before each LF without causing any problems.

Well, er... umm... I wrote it.  It replaces the \r with a blank.    It's 
very fast (C code), doesn't change the size of the file and converts 
them in place.  I simply drag and drop the file needing to be converted 
onto my desktop icon and it's done a split second later.

What should it be doing?   If I changed the \r to a \n, wouldn't I get 
double spacing?

Thanks, Todd
-- 
Posted via http://www.ruby-forum.com/.