From 833977416ff8cbdcf0ebd8a6a135d7ef13fdbd73 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 25 Sep 2012 14:55:12 -0700 Subject: UTF8: use universalNewlineMode in reading. This treats both '\r\n' and '\n' as '\n' on input, no matter what platform we're running on. --- src/Text/Pandoc/UTF8.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/UTF8.hs') diff --git a/src/Text/Pandoc/UTF8.hs b/src/Text/Pandoc/UTF8.hs index aa3a9da04..5be7d3c8e 100644 --- a/src/Text/Pandoc/UTF8.hs +++ b/src/Text/Pandoc/UTF8.hs @@ -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 -- cgit v1.2.3