git.iko.soy/typeable/pandoc
on master help sign in
UTF8: use universalNewlineMode in reading.

This treats both '\r\n' and '\n' as '\n' on input, no matter what platform we're running on.

commit833977416ff8cbdcf0ebd8a6a135d7ef13fdbd73 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 25 Sep 2012, 14:55 (14 years ago) parent4ab30f3
1 file changed+2−1
src/Text/Pandoc/UTF8.hs+2−1
src/Text/Pandoc/UTF8.hs+2−1
@@ -75,7 +75,8 @@ hPutStrLn :: Handle -> String -> IO ()
7575hPutStrLn h s = hSetEncoding h utf8 >> IO.hPutStrLn h s
7676
7777hGetContents :: Handle -> IO String
78−hGetContents h = hSetEncoding h utf8_bom >> IO.hGetContents h
78+hGetContents h = hSetEncoding h utf8_bom >> hSetNewlineMode h universalNewlineMode
79+ >> IO.hGetContents h
7980
8081encodePath :: FilePath -> FilePath
8182decodeArg :: String -> String