What is a reliable way to detect which line break characters are used in a file?
- by Fabian Jakobs
I'm reading text files but I don't know in advance the kind of line ending used in this file. I need to know whether it uses UNIX \n or windows style \r\n line endings.
What is a reliable and fast way to detect this?