summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorMichael Snoyman <michael@snoyman.com>2015-08-18 17:58:02 +0200
committerBen Gamari <bgamari.foss@gmail.com>2015-08-18 12:32:28 -0400
commit22aca5368864070bbed3b44dca3ce57e243bf415 (patch)
tree6a616cb867a75bccecc041282136c58bf8107faf /ghc
parent74897dece3ea92139b552bd711903ce630956df3 (diff)
downloadhaskell-22aca5368864070bbed3b44dca3ce57e243bf415.tar.gz
Transliterate unknown characters at output
This avoids the compiler from crashing when, for example, a warning contains a non-Latin identifier and the LANG variable is set to C. Fixes #6037. Test Plan: Create a Haskell source file containing an identifier with non-Latin characters and no type signature. Compile with `LANG=C ghc -Wall foo.hs`, and it should fail. With this patch, it will succeed. Reviewers: austin, rwbarton, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1153 GHC Trac Issues: #6037, #10762
Diffstat (limited to 'ghc')
-rw-r--r--ghc/Main.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 201ee5d8d2..ed2ac67fa6 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -80,6 +80,9 @@ main = do
initGCStatistics -- See Note [-Bsymbolic and hooks]
hSetBuffering stdout LineBuffering
hSetBuffering stderr LineBuffering
+ hSetTranslit stdout
+ hSetTranslit stderr
+
GHC.defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
-- 1. extract the -B flag from the args
argv0 <- getArgs