use the native unicode support from GHC 6.12

This commit is contained in:
krasimir
2010-04-19 09:38:36 +00:00
parent 4c757f4683
commit 0b6b30d4a8
23 changed files with 177 additions and 490 deletions

View File

@@ -17,6 +17,7 @@ import Data.Maybe
import Data.Binary
import System.FilePath
import System.IO
import Control.Exception
mainGFC :: Options -> [FilePath] -> IOE ()
@@ -81,8 +82,8 @@ writeOutput opts file str =
do let path = case flag optOutputDir opts of
Nothing -> file
Just dir -> dir </> file
writeOutputFile opts path str
writeOutputFile :: Options -> FilePath -> String -> IOE ()
writeOutputFile opts outfile output =
do putPointE Normal opts ("Writing " ++ outfile ++ "...") $ ioeIO $ writeFile outfile output
putPointE Normal opts ("Writing " ++ path ++ "...") $ ioeIO $
bracket
(openFile path WriteMode)
(hClose)
(\h -> hSetEncoding h utf8 >> hPutStr h str)