From 9b9905c0b27c59c1dd49cdfdfb6b14dddc8f77d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Wed, 18 May 2022 14:42:01 +0800 Subject: [PATCH] Always use UTF8 encoding in the gf executable This fixes many of the "Invalid character" messages you can get on different platforms. This has helped both with a nix-installation that didn't have global locale set and with a windows installation. --- src/compiler/GF/Main.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/GF/Main.hs b/src/compiler/GF/Main.hs index 7d4500c7b..1b90430d6 100644 --- a/src/compiler/GF/Main.hs +++ b/src/compiler/GF/Main.hs @@ -16,6 +16,7 @@ import Data.Version import System.Directory import System.Environment (getArgs) import System.Exit +import GHC.IO.Encoding -- import GF.System.Console (setConsoleEncoding) -- | Run the GF main program, taking arguments from the command line. @@ -23,6 +24,7 @@ import System.Exit -- Run @gf --help@ for usage info. main :: IO () main = do + setLocaleEncoding utf8 -- setConsoleEncoding uncurry mainOpts =<< getOptions