diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-07-23 12:19:13 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-07-23 12:19:13 +0000 |
commit | cab2a4c125b422d675aa5ba086e3f94e97e9f81b (patch) | |
tree | e8aa17399433043520e19b98048d0ac57cc940f6 /ghc/InteractiveUI.hs | |
parent | aa0c0de94e25aa64139688f8e4c4ba51ddca6f54 (diff) | |
download | haskell-cab2a4c125b422d675aa5ba086e3f94e97e9f81b.tar.gz |
Windows only: set the encoding on stdin to utf8
Otherwise it defaults to latin1.
Diffstat (limited to 'ghc/InteractiveUI.hs')
-rw-r--r-- | ghc/InteractiveUI.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 5acb36e57d..367539863c 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -328,6 +328,12 @@ interactiveUI srcs maybe_exprs = do -- We don't want the cmd line to buffer any input that might be -- intended for the program, so unbuffer stdin. hSetBuffering stdin NoBuffering +#if defined(mingw32_HOST_OS) && __GLASGOW_HASKELL__ >= 611 + -- On Unix, stdin will use the locale encoding. The IO library + -- doesn't do this on Windows (yet), so for now we use UTF-8, + -- for consistency with GHC 6.10 and to make the tests work. + hSetEncoding stdin utf8 +#endif -- initial context is just the Prelude prel_mod <- GHC.lookupModule (GHC.mkModuleName "Prelude") Nothing |