aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-09-25 14:55:12 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-09-25 14:55:12 -0700
commit833977416ff8cbdcf0ebd8a6a135d7ef13fdbd73 (patch)
treec595b1b614595c7bf97a007fc7a4e4ef4e4f4ae9 /src/Text
parent4ab30f3ceaec427b6f89f2fe32cef4b0b1b5e955 (diff)
downloadpandoc-833977416ff8cbdcf0ebd8a6a135d7ef13fdbd73.tar.gz
UTF8: use universalNewlineMode in reading.
This treats both '\r\n' and '\n' as '\n' on input, no matter what platform we're running on.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/UTF8.hs3
1 files changed, 2 insertions, 1 deletions
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