Export encodePath/decodePath from UTF8.

Removed duplicate code in src/pandoc.hs.
This commit is contained in:
John MacFarlane 2012-09-23 10:43:03 -07:00
parent 22bd34fa33
commit 51178dda97
2 changed files with 2 additions and 15 deletions

View file

@ -35,6 +35,7 @@ module Text.Pandoc.UTF8 ( readFile
, hPutStr
, hPutStrLn
, hGetContents
, encodePath
)
where

View file

@ -59,20 +59,6 @@ import Network.URI (parseURI, isURI, URI(..))
import qualified Data.ByteString.Lazy as B
import Data.ByteString.Lazy.UTF8 (toString)
import Text.CSL.Reference (Reference(..))
#if MIN_VERSION_base(4,4,0)
#else
import Codec.Binary.UTF8.String (decodeString, encodeString)
#endif
encodePath, decodeArg :: FilePath -> FilePath
#if MIN_VERSION_base(4,4,0)
encodePath = id
decodeArg = id
#else
encodePath = encodeString
decodeArg = decodeString
#endif
copyrightMessage :: String
copyrightMessage = "\nCopyright (C) 2006-2012 John MacFarlane\n" ++
@ -1037,7 +1023,7 @@ main = do
else return doc1
let writeBinary :: B.ByteString -> IO ()
writeBinary = B.writeFile (encodePath outputFile)
writeBinary = B.writeFile (UTF8.encodePath outputFile)
let writerFn :: FilePath -> String -> IO ()
writerFn "-" = UTF8.putStr