diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-09-23 10:43:03 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-09-23 10:43:03 -0700 |
commit | 51178dda976fd358bcd091f833254542006cebcc (patch) | |
tree | 4a2ab2775ea60850c7306a16945e1c1749706c6f | |
parent | 22bd34fa338edc5fb38cce5adfa11ffbc451b0d4 (diff) | |
download | pandoc-51178dda976fd358bcd091f833254542006cebcc.tar.gz |
Export encodePath/decodePath from UTF8.
Removed duplicate code in src/pandoc.hs.
-rw-r--r-- | src/Text/Pandoc/UTF8.hs | 1 | ||||
-rw-r--r-- | src/pandoc.hs | 16 |
2 files changed, 2 insertions, 15 deletions
diff --git a/src/Text/Pandoc/UTF8.hs b/src/Text/Pandoc/UTF8.hs index 508ad30a9..506686972 100644 --- a/src/Text/Pandoc/UTF8.hs +++ b/src/Text/Pandoc/UTF8.hs @@ -35,6 +35,7 @@ module Text.Pandoc.UTF8 ( readFile , hPutStr , hPutStrLn , hGetContents + , encodePath ) where diff --git a/src/pandoc.hs b/src/pandoc.hs index cb561e817..9cfaaeefe 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -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 |