diff options
| author | krasimir <krasimir@chalmers.se> | 2010-04-19 09:38:36 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-04-19 09:38:36 +0000 |
| commit | 6313244eacf992fb10a5091bee28582e84540809 (patch) | |
| tree | 8208fb18a5e1ab9447bd060cf08a3d78ed0a8c0a /src/compiler/GFC.hs | |
| parent | 8b5827fc892c2f395ae26f1811da2d4cc3b1669d (diff) | |
use the native unicode support from GHC 6.12
Diffstat (limited to 'src/compiler/GFC.hs')
| -rw-r--r-- | src/compiler/GFC.hs | 11 |
1 files changed, 6 insertions, 5 deletions
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) |
