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:
1 parent
4ab30f3cea
commit
833977416f
1 file changed
+2
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user