@@ -363,7 +363,7 @@ options =
363363 , Option "H" ["include-in-header"]
364364 (ReqArg
365365 (\arg opt -> do
366− text <- UTF8.readFile arg
366+ text <- readFile arg
367367 -- add new ones to end, so they're included in order specified
368368 let newvars = optVariables opt ++ [("header-includes",text)]
369369 return opt { optVariables = newvars,
@@ -374,7 +374,7 @@ options =
374374 , Option "B" ["include-before-body"]
375375 (ReqArg
376376 (\arg opt -> do
377− text <- UTF8.readFile arg
377+ text <- readFile arg
378378 -- add new ones to end, so they're included in order specified
379379 let newvars = optVariables opt ++ [("include-before",text)]
380380 return opt { optVariables = newvars,
@@ -385,7 +385,7 @@ options =
385385 , Option "A" ["include-after-body"]
386386 (ReqArg
387387 (\arg opt -> do
388− text <- UTF8.readFile arg
388+ text <- readFile arg
389389 -- add new ones to end, so they're included in order specified
390390 let newvars = optVariables opt ++ [("include-after",text)]
391391 return opt { optVariables = newvars,
@@ -528,7 +528,7 @@ options =
528528 , Option "" ["epub-stylesheet"]
529529 (ReqArg
530530 (\arg opt -> do
531− text <- UTF8.readFile arg
531+ text <- readFile arg
532532 return opt { optEPUBStylesheet = Just text })
533533 "FILENAME")
534534 "" -- "Path of epub.css"
@@ -544,7 +544,7 @@ options =
544544 , Option "" ["epub-metadata"]
545545 (ReqArg
546546 (\arg opt -> do
547− text <- UTF8.readFile arg
547+ text <- readFile arg
548548 return opt { optEPUBMetadata = text })
549549 "FILENAME")
550550 "" -- "Path of epub metadata file"
@@ -756,7 +756,7 @@ defaultWriterName x =
756756main :: IO ()
757757main = do
758758
759− rawArgs <- liftM (map decodeArg) getArgs
759+ rawArgs <- liftM (map UTF8.decodeArg) getArgs
760760 prg <- getProgName
761761 let compatMode = (prg == "hsmarkdown")
762762
@@ -888,7 +888,7 @@ main = do
888888 let tp' = case takeExtension tp of
889889 "" -> tp <.> format
890890 _ -> tp
891− E.catch (UTF8.readFile tp')
891+ E.catch (readFile tp')
892892 (\e -> if isDoesNotExistError e
893893 then E.catch
894894 (readDataFile datadir $
@@ -982,11 +982,11 @@ main = do
982982
983983 let readSources [] = mapM readSource ["-"]
984984 readSources srcs = mapM readSource srcs
985− readSource "-" = UTF8.getContents
985+ readSource "-" = getContents
986986 readSource src = case parseURI src of
987987 Just u | uriScheme u `elem` ["http:","https:"] ->
988988 readURI u
989− _ -> UTF8.readFile src
989+ _ -> readFile src
990990 readURI uri = simpleHTTP (mkRequest GET uri) >>= getResponseBody >>=
991991 return . toString -- treat all as UTF8
992992
@@ -1026,8 +1026,8 @@ main = do
10261026 writeBinary = B.writeFile (UTF8.encodePath outputFile)
10271027
10281028 let writerFn :: FilePath -> String -> IO ()
1029− writerFn "-" = UTF8.putStr
1030− writerFn f = UTF8.writeFile f
1029+ writerFn "-" = putStr
1030+ writerFn f = writeFile (UTF8.encodePath f)
10311031
10321032 case getWriter writerName' of
10331033 Left e -> err 9 e