From 09b050b24597a21343f712e4bc7b6f8660113d63 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Sep 2015 17:02:00 -0400 Subject: fsck: Work around bug in persistent that broke display of problematically encoded filenames on stderr when using --incremental. --- Messages.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Messages.hs') diff --git a/Messages.hs b/Messages.hs index 026fca51e..fce5c179a 100644 --- a/Messages.hs +++ b/Messages.hs @@ -30,6 +30,7 @@ module Messages ( showHeader, showRaw, setupConsole, + setConsoleEncoding, enableDebugOutput, disableDebugOutput, debugEnabled, @@ -176,9 +177,12 @@ setupConsole = do <$> streamHandler stderr DEBUG <*> pure preciseLogFormatter updateGlobalLogger rootLoggerName (setLevel NOTICE . setHandlers [s]) - {- This avoids ghc's output layer crashing on - - invalid encoded characters in - - filenames when printing them out. -} + setConsoleEncoding + +{- This avoids ghc's output layer crashing on invalid encoded characters in + - filenames when printing them out. -} +setConsoleEncoding :: IO () +setConsoleEncoding = do fileEncoding stdout fileEncoding stderr -- cgit v1.2.3