1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Merge remote-tracking branch 'origin/master' into cache-and-discard-feature-vectors

This commit is contained in:
Rob Rix 2017-02-09 10:16:14 -05:00
commit 2e386dc76f

View File

@ -114,7 +114,11 @@ writeToOutput output text =
case output of
Nothing -> do
lang <- lookupEnv "LANG"
if isNothing lang then IO.hSetEncoding IO.stdout IO.utf8 else pure ()
case lang of
-- If LANG is set and isn't the empty string, leave the encoding.
Just x | x /= "" -> pure ()
-- Otherwise default to utf8.
_ -> IO.hSetEncoding IO.stdout IO.utf8
TextIO.hPutStrLn IO.stdout text
Just path -> do
isDir <- doesDirectoryExist path