@@ -363,7 +363,7 @@ options =
363 , Option "H" ["include-in-header"]
363 , Option "H" ["include-in-header"]
365 (\arg opt -> do
365 (\arg opt -> do
366− text <- readFile arg
366+ text <- UTF8.readFile arg
367 -- add new ones to end, so they're included in order specified
367 -- add new ones to end, so they're included in order specified
368 let newvars = optVariables opt ++ [("header-includes",text)]
368 let newvars = optVariables opt ++ [("header-includes",text)]
369 return opt { optVariables = newvars,
369 return opt { optVariables = newvars,
@@ -374,7 +374,7 @@ options =
374 , Option "B" ["include-before-body"]
374 , Option "B" ["include-before-body"]
376 (\arg opt -> do
376 (\arg opt -> do
377− text <- readFile arg
377+ text <- UTF8.readFile arg
378 -- add new ones to end, so they're included in order specified
378 -- add new ones to end, so they're included in order specified
379 let newvars = optVariables opt ++ [("include-before",text)]
379 let newvars = optVariables opt ++ [("include-before",text)]
380 return opt { optVariables = newvars,
380 return opt { optVariables = newvars,
@@ -385,7 +385,7 @@ options =
385 , Option "A" ["include-after-body"]
385 , Option "A" ["include-after-body"]
387 (\arg opt -> do
387 (\arg opt -> do
388− text <- readFile arg
388+ text <- UTF8.readFile arg
389 -- add new ones to end, so they're included in order specified
389 -- add new ones to end, so they're included in order specified
390 let newvars = optVariables opt ++ [("include-after",text)]
390 let newvars = optVariables opt ++ [("include-after",text)]
391 return opt { optVariables = newvars,
391 return opt { optVariables = newvars,
@@ -528,7 +528,7 @@ options =
528 , Option "" ["epub-stylesheet"]
528 , Option "" ["epub-stylesheet"]
530 (\arg opt -> do
530 (\arg opt -> do
531− text <- readFile arg
531+ text <- UTF8.readFile arg
532 return opt { optEPUBStylesheet = Just text })
532 return opt { optEPUBStylesheet = Just text })
533 "FILENAME")
533 "FILENAME")
534 "" -- "Path of epub.css"
534 "" -- "Path of epub.css"
@@ -544,7 +544,7 @@ options =
544 , Option "" ["epub-metadata"]
544 , Option "" ["epub-metadata"]
546 (\arg opt -> do
546 (\arg opt -> do
547− text <- readFile arg
547+ text <- UTF8.readFile arg
548 return opt { optEPUBMetadata = text })
548 return opt { optEPUBMetadata = text })
549 "FILENAME")
549 "FILENAME")
550 "" -- "Path of epub metadata file"
550 "" -- "Path of epub metadata file"
@@ -756,7 +756,7 @@ defaultWriterName x =
756main :: IO ()
756main :: IO ()
759− rawArgs <- liftM (map UTF8.decodeArg) getArgs
759+ rawArgs <- liftM (map decodeArg) getArgs
760 prg <- getProgName
760 prg <- getProgName
761 let compatMode = (prg == "hsmarkdown")
761 let compatMode = (prg == "hsmarkdown")
@@ -888,7 +888,7 @@ main = do
888 let tp' = case takeExtension tp of
888 let tp' = case takeExtension tp of
889 "" -> tp <.> format
889 "" -> tp <.> format
891− E.catch (readFile tp')
891+ E.catch (UTF8.readFile tp')
892 (\e -> if isDoesNotExistError e
892 (\e -> if isDoesNotExistError e
893 then E.catch
893 then E.catch
894 (readDataFile datadir $
894 (readDataFile datadir $
@@ -982,11 +982,11 @@ main = do
983 let readSources [] = mapM readSource ["-"]
983 let readSources [] = mapM readSource ["-"]
984 readSources srcs = mapM readSource srcs
984 readSources srcs = mapM readSource srcs
985− readSource "-" = getContents
985+ readSource "-" = UTF8.getContents
986 readSource src = case parseURI src of
986 readSource src = case parseURI src of
987 Just u | uriScheme u `elem` ["http:","https:"] ->
987 Just u | uriScheme u `elem` ["http:","https:"] ->
988 readURI u
988 readURI u
989− _ -> readFile src
989+ _ -> UTF8.readFile src
990 readURI uri = simpleHTTP (mkRequest GET uri) >>= getResponseBody >>=
990 readURI uri = simpleHTTP (mkRequest GET uri) >>= getResponseBody >>=
991 return . toString -- treat all as UTF8
991 return . toString -- treat all as UTF8
@@ -1026,8 +1026,8 @@ main = do
1026 writeBinary = B.writeFile (UTF8.encodePath outputFile)
1026 writeBinary = B.writeFile (UTF8.encodePath outputFile)
1028 let writerFn :: FilePath -> String -> IO ()
1028 let writerFn :: FilePath -> String -> IO ()
1029− writerFn "-" = putStr
1029+ writerFn "-" = UTF8.putStr
1030− writerFn f = writeFile (UTF8.encodePath f)
1030+ writerFn f = UTF8.writeFile f
1032 case getWriter writerName' of
1032 case getWriter writerName' of
1033 Left e -> err 9 e
1033 Left e -> err 9 e