summaryrefslogtreecommitdiff
path: root/src/compiler/GF.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-10-05 12:54:49 +0000
committerhallgren <hallgren@chalmers.se>2012-10-05 12:54:49 +0000
commitb5bf276e9c82505038f4269a77ba3c6e201438bb (patch)
tree49631e5553bd676b8ab4fd07fa8f4cebd3de0dee /src/compiler/GF.hs
parent2d371b768122695ce0bd37f10e3d6b0381c31a57 (diff)
Factor out code for setting the console encoding
Moved similar low-level code blocks in Main and GFI for setting the console encoding to the new module GF.System.Console.
Diffstat (limited to 'src/compiler/GF.hs')
-rw-r--r--src/compiler/GF.hs16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/compiler/GF.hs b/src/compiler/GF.hs
index 40ce7fed3..04748b85b 100644
--- a/src/compiler/GF.hs
+++ b/src/compiler/GF.hs
@@ -1,4 +1,3 @@
-{-# OPTIONS -cpp #-}
module Main where
import GFC
@@ -14,22 +13,11 @@ import System.Directory
import System.Environment (getArgs)
import System.Exit
import System.IO
-#ifdef mingw32_HOST_OS
-import System.Win32.Console
-import System.Win32.NLS
-#endif
+import GF.System.Console (setConsoleEncoding)
main :: IO ()
main = do
-#ifdef mingw32_HOST_OS
- codepage <- getACP
- setConsoleCP codepage
- setConsoleOutputCP codepage
- enc <- mkTextEncoding ("CP"++show codepage)
- hSetEncoding stdin enc
- hSetEncoding stdout enc
- hSetEncoding stderr enc
-#endif
+ setConsoleEncoding
args <- getArgs
case parseOptions args of
Ok (opts,files) -> do curr_dir <- getCurrentDirectory