1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 05:58:34 +03:00

Merge branch 'master' into go-receiver-toc-iteration

This commit is contained in:
Timothy Clem 2017-02-09 10:54:35 -08:00 committed by GitHub
commit 5f91bc426f

View File

@ -113,7 +113,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