diff options
author | Michael Snoyman <michael@snoyman.com> | 2015-08-18 17:58:02 +0200 |
---|---|---|
committer | Ben Gamari <bgamari.foss@gmail.com> | 2015-08-18 12:32:28 -0400 |
commit | 22aca5368864070bbed3b44dca3ce57e243bf415 (patch) | |
tree | 6a616cb867a75bccecc041282136c58bf8107faf /ghc | |
parent | 74897dece3ea92139b552bd711903ce630956df3 (diff) | |
download | haskell-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.hs | 3 |
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 |