@@ -30,7 +30,6 @@ writers.
3030-}
3131module Main where
3232import Text.Pandoc
33−import Text.Pandoc.UTF8
3433import Text.Pandoc.ODT
3534import Text.Pandoc.Shared ( joinWithSep, HTMLMathMethod (..) )
3635import Text.Pandoc.Highlighting ( languages )
@@ -38,7 +37,9 @@ import System.Environment ( getArgs, getProgName, getEnvironment )
3837import System.Exit ( exitWith, ExitCode (..) )
3938import System.FilePath ( takeExtension, takeDirectory )
4039import System.Console.GetOpt
41−import System.IO
40+import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
41+import System.IO ( stdout, stderr )
42+import System.IO.UTF8
4243import Data.Maybe ( fromMaybe )
4344import Data.Char ( toLower )
4445import Control.Monad ( (>>=) )
@@ -275,7 +276,7 @@ options =
275276 (\arg opt -> do
276277 let old = optIncludeInHeader opt
277278 text <- readFile arg
278− return opt { optIncludeInHeader = old ++ fromUTF8 text,
279+ return opt { optIncludeInHeader = old ++ text,
279280 optStandalone = True })
280281 "FILENAME")
281282 "" -- "File to include at end of header (implies -s)"
@@ -285,7 +286,7 @@ options =
285286 (\arg opt -> do
286287 let old = optIncludeBeforeBody opt
287288 text <- readFile arg
288− return opt { optIncludeBeforeBody = old ++ fromUTF8 text })
289+ return opt { optIncludeBeforeBody = old ++ text })
289290 "FILENAME")
290291 "" -- "File to include before document body"
291292
@@ -294,7 +295,7 @@ options =
294295 (\arg opt -> do
295296 let old = optIncludeAfterBody opt
296297 text <- readFile arg
297− return opt { optIncludeAfterBody = old ++ fromUTF8 text })
298+ return opt { optIncludeAfterBody = old ++ text })
298299 "FILENAME")
299300 "" -- "File to include after document body"
300301
@@ -302,7 +303,7 @@ options =
302303 (ReqArg
303304 (\arg opt -> do
304305 text <- readFile arg
305− return opt { optCustomHeader = fromUTF8 text,
306+ return opt { optCustomHeader = text,
306307 optStandalone = True })
307308 "FILENAME")
308309 "" -- "File to use for custom header (implies -s)"
@@ -555,10 +556,11 @@ main = do
555556 then putStrLn
556557 else writeFile outputFile . (++ "\n")
557558
558− (readSources sources) >>= writeOutput . toUTF8 .
559− (writer writerOptions) .
560− (reader startParserState) . tabFilter tabStop .
561− fromUTF8 . (joinWithSep "\n")
559+ (readSources sources) >>= writeOutput .
560+ writer writerOptions .
561+ reader startParserState .
562+ tabFilter tabStop .
563+ joinWithSep "\n"
562564
563565 where
564566 readSources [] = mapM readSource ["-"]