There's no good way to iterate over all newlines with BufReadΒ #55743
Open
Description
opened on Nov 7, 2018
If you have files with a newline of '\r', the only way to handle them is to use split. But if you have files with a newline of '\n' or '\r\n', then you can use lines().
This is counterintuitive and problematic from the perspective of the BufRead interface - there's no way to use it to iterate over any of the three types. I'd typically expect that lines() would handle this transparently.
I'm not sure if this is the right place, but I don't want it to get lost because it cost me major hassle.
Activity