UTF8: use universalNewlineMode in reading.

This treats both '\r\n' and '\n' as '\n' on input, no matter
what platform we're running on.
This commit is contained in:
John MacFarlane 2012-09-25 14:55:12 -07:00
parent 4ab30f3cea
commit 833977416f

View file

@ -75,7 +75,8 @@ hPutStrLn :: Handle -> String -> IO ()
hPutStrLn h s = hSetEncoding h utf8 >> IO.hPutStrLn h s
hGetContents :: Handle -> IO String
hGetContents h = hSetEncoding h utf8_bom >> IO.hGetContents h
hGetContents h = hSetEncoding h utf8_bom >> hSetNewlineMode h universalNewlineMode
>> IO.hGetContents h
encodePath :: FilePath -> FilePath
decodeArg :: String -> String