summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Källberg <anka.213@gmail.com>2022-05-18 14:42:01 +0800
committerAndreas Källberg <anka.213@gmail.com>2022-05-18 14:42:01 +0800
commit9b9905c0b27c59c1dd49cdfdfb6b14dddc8f77d0 (patch)
tree0b53f8bd5ccef1cdf2722c55cd7a3342cd6d2bbb
parentec70e4a83e75691264a6f227819a90e123905a68 (diff)
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.
-rw-r--r--src/compiler/GF/Main.hs2
1 files changed, 2 insertions, 0 deletions
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