http://qs321.pair.com?node_id=103273


in reply to Re: Quick and portable way to determine line-ending string?
in thread Quick and portable way to determine line-ending string?

Sadly, one can't assume that. For instance, I have seen a number of cases where a supposedly-text file from a Unix system has been edited on a MS-DOSish system and hence contains extra "\x0d" characters.

Then, of course, there's the question of what to do on EBCDIC systems, where the line endings are likely to be something entirely different.