summaryrefslogtreecommitdiff
path: root/utils/ghc-pkg
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-05-13 18:36:59 -0400
committerBen Gamari <ben@smart-cactus.org>2018-05-13 22:22:43 -0400
commitcf88c2b109a9f36d151af7fa0e542c48c98115fa (patch)
treed5062954d5a55e88a9a8808751dfc8ae8f4fbd9a /utils/ghc-pkg
parent21e1a00c0ccf3072ccc04cd1acfc541c141189d2 (diff)
downloadhaskell-cf88c2b109a9f36d151af7fa0e542c48c98115fa.tar.gz
ghc-pkg: Configure handle encodings
This fixes #15021 using a the same approach as was used to fix the issue in ghc (#10762). Test Plan: Validate on Windows as user whose username contains non-ASCII characters Reviewers: simonmar Reviewed By: simonmar Subscribers: lehins, thomie, carter GHC Trac Issues: #15021 Differential Revision: https://phabricator.haskell.org/D4642
Diffstat (limited to 'utils/ghc-pkg')
-rw-r--r--utils/ghc-pkg/Main.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 0e793b4917..a32252139f 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -30,6 +30,7 @@ module Main (main) where
import Version ( version, targetOS, targetARCH )
import qualified GHC.PackageDb as GhcPkg
import GHC.PackageDb (BinaryStringRep(..))
+import GHC.HandleEncoding
import qualified Distribution.Simple.PackageIndex as PackageIndex
import qualified Data.Graph as Graph
import qualified Distribution.ModuleName as ModuleName
@@ -120,6 +121,7 @@ anyM p (x:xs) = do
main :: IO ()
main = do
+ configureHandleEncoding
args <- getArgs
case getOpt Permute (flags ++ deprecFlags) args of