Transliterate unknown characters at output
authorMichael Snoyman <michael@snoyman.com>
Tue, 18 Aug 2015 15:58:02 +0000 (17:58 +0200)
committerBen Gamari <bgamari.foss@gmail.com>
Tue, 18 Aug 2015 16:32:28 +0000 (12:32 -0400)
commit22aca5368864070bbed3b44dca3ce57e243bf415
tree6a616cb867a75bccecc041282136c58bf8107faf
parent74897dece3ea92139b552bd711903ce630956df3
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
compiler/utils/Util.hs
ghc/Main.hs
testsuite/tests/driver/all.T