git.iko.soy/typeable/pandoc
on master help sign in
Export encodePath/decodePath from UTF8.
51178ddJohn MacFarlane
src/Text/Pandoc/UTF8.hs+1
@@ -35,6 +35,7 @@ module Text.Pandoc.UTF8 ( readFile
35 , hPutStr
35 , hPutStr
36 , hPutStrLn
36 , hPutStrLn
37 , hGetContents
37 , hGetContents
38+ , encodePath
38 )
39 )
39
40
40where
41where
src/pandoc.hs+1−15
@@ -59,20 +59,6 @@ import Network.URI (parseURI, isURI, URI(..))
59import qualified Data.ByteString.Lazy as B
59import qualified Data.ByteString.Lazy as B
60import Data.ByteString.Lazy.UTF8 (toString)
60import Data.ByteString.Lazy.UTF8 (toString)
61import Text.CSL.Reference (Reference(..))
61import Text.CSL.Reference (Reference(..))
62−#if MIN_VERSION_base(4,4,0)
63−#else
64−import Codec.Binary.UTF8.String (decodeString, encodeString)
65−#endif
66−
67−encodePath, decodeArg :: FilePath -> FilePath
68−#if MIN_VERSION_base(4,4,0)
69−encodePath = id
70−decodeArg = id
71−#else
72−encodePath = encodeString
73−decodeArg = decodeString
74−#endif
75−
76
62
77copyrightMessage :: String
63copyrightMessage :: String
78copyrightMessage = "\nCopyright (C) 2006-2012 John MacFarlane\n" ++
64copyrightMessage = "\nCopyright (C) 2006-2012 John MacFarlane\n" ++
@@ -1037,7 +1023,7 @@ main = do
1037 else return doc1
1023 else return doc1
1038
1024
1039 let writeBinary :: B.ByteString -> IO ()
1025 let writeBinary :: B.ByteString -> IO ()
1040− writeBinary = B.writeFile (encodePath outputFile)
1026+ writeBinary = B.writeFile (UTF8.encodePath outputFile)
1041
1027
1042 let writerFn :: FilePath -> String -> IO ()
1028 let writerFn :: FilePath -> String -> IO ()
1043 writerFn "-" = UTF8.putStr
1029 writerFn "-" = UTF8.putStr