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