Skip to content

Commit

Permalink
Re #292: GHC.IO.Handle.utf8 --> GHC.IO.Encoding.utf8
Browse files Browse the repository at this point in the history
Was possibly a regression in 0.18.
We do not seem to cover this by the test-suite.
  • Loading branch information
andreasabel authored and sol committed Nov 13, 2021
1 parent 8d594a8 commit b145059
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ghci-wrapper/src/Language/Haskell/GhciWrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ new Config{..} args_ = do
setMode stdout_
let interpreter = Interpreter {hIn = stdin_, hOut = stdout_, process = processHandle}
_ <- eval interpreter "import qualified System.IO"
_ <- eval interpreter "import qualified GHC.IO.Encoding"
_ <- eval interpreter "import qualified GHC.IO.Handle"
-- The buffering of stdout and stderr is NoBuffering
_ <- eval interpreter "GHC.IO.Handle.hDuplicateTo System.IO.stdout System.IO.stderr"
Expand All @@ -66,8 +67,8 @@ new Config{..} args_ = do

-- this is required on systems that don't use utf8 as default encoding (e.g.
-- Windows)
_ <- eval interpreter "GHC.IO.Handle.hSetEncoding System.IO.stdout GHC.IO.Handle.utf8"
_ <- eval interpreter "GHC.IO.Handle.hSetEncoding System.IO.stderr GHC.IO.Handle.utf8"
_ <- eval interpreter "GHC.IO.Handle.hSetEncoding System.IO.stdout GHC.IO.Encoding.utf8"
_ <- eval interpreter "GHC.IO.Handle.hSetEncoding System.IO.stderr GHC.IO.Encoding.utf8"

_ <- eval interpreter ":m - System.IO"
_ <- eval interpreter ":m - GHC.IO.Handle"
Expand Down

0 comments on commit b145059

Please sign in to comment.