Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nowadays I see in-flight EOL normalization as Considered Harmful; instead I ensure that routines dealing with text buffers treat both CRLF and LF as the same. This has Just Worked without any issues in the software I've written with this approach. (Occasionally this requires wrapping/replacing library code that only uses the EOL convention of the host system.)

I have encountered numerous issues with EOLs being changed in transit or on disk, so I always make sure to open/transfer files in "binary mode", since both Windows and Linux builds will run the same EOL-agnostic code.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: