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:
parent
4ab30f3cea
commit
833977416f
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue