@@ -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