From 6313244eacf992fb10a5091bee28582e84540809 Mon Sep 17 00:00:00 2001 From: krasimir Date: Mon, 19 Apr 2010 09:38:36 +0000 Subject: use the native unicode support from GHC 6.12 --- src/compiler/GFC.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/compiler/GFC.hs') diff --git a/src/compiler/GFC.hs b/src/compiler/GFC.hs index 8037d4f1a..1f0ac870b 100644 --- a/src/compiler/GFC.hs +++ b/src/compiler/GFC.hs @@ -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) -- cgit v1.2.3