git.iko.soy/typeable/pandoc
on master help sign in
UTF8: Encode filenames.

(This is still needed, even with recent base.) Partially resolves Issue #286 (though now there is a new markdown2pdf problem).

commit37fa6df612c5d02acd7ff177293e2d7c4630ccb2 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 11 Feb 2011, 18:55 (16 years ago) parent459e460
1 file changed+3−2
src/Text/Pandoc/UTF8.hs+3−2
src/Text/Pandoc/UTF8.hs+3−2
@@ -44,15 +44,16 @@ where
4444import System.IO hiding (readFile, writeFile, getContents,
4545 putStr, putStrLn, hPutStr, hPutStrLn, hGetContents)
4646import Prelude hiding (readFile, writeFile, getContents, putStr, putStrLn )
47+import Codec.Binary.UTF8.String (encodeString)
4748import qualified System.IO as IO
4849
4950readFile :: FilePath -> IO String
5051readFile f = do
51− h <- openFile f ReadMode
52+ h <- openFile (encodeString f) ReadMode
5253 hGetContents h
5354
5455writeFile :: FilePath -> String -> IO ()
55−writeFile f s = withFile f WriteMode $ \h -> hPutStr h s
56+writeFile f s = withFile (encodeString f) WriteMode $ \h -> hPutStr h s
5657
5758getContents :: IO String
5859getContents = hGetContents stdin