@@ -44,16 +44,20 @@ import System.Directory
4444import System.Exit
4545import System.FilePath
4646import System.IO
47+import System.IO.CodePage (withCP65001)
4748import Text.Trifecta.Result (ErrInfo(..), Result(..))
4849
4950-- | How to run Idris programs.
5051runMain :: Idris () -> IO ()
51−runMain prog = do res <- runExceptT $ execStateT prog idrisInit
52− case res of
53− Left err -> do
54− putStrLn $ "Uncaught error: " ++ show err
55− exitFailure
56− Right _ -> return ()
52+runMain prog = withCP65001 $ do
53+ -- Run in codepage 65001 on Windows so that UTF-8 characters can
54+ -- be displayed properly. See #3000.
55+ res <- runExceptT $ execStateT prog idrisInit
56+ case res of
57+ Left err -> do
58+ putStrLn $ "Uncaught error: " ++ show err
59+ exitFailure
60+ Right _ -> return ()
5761
5862-- | The main function of Idris that when given a set of Options will
5963-- launch Idris into the desired interaction mode either: REPL;