Looking at the source of BS.hGetLine
, I see that '\n'
is hardcoded:
[...]
-- find the end-of-line character, if there is one
findEOL r w raw
| r == w = return w
| otherwise = do
(c,r') <- readCharFromBuffer raw r
if c == '\n'
then return r -- NB. not r': don't include the '\n'
else findEOL r' w raw
[...]
This helper must be changed to use haInputNL
from the provided Handle
instead of the hardcoded value if we want it to take the newline mode into account. I suggest filing a bug report.