1
0
forked from GitHub/gf-core

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.
This commit is contained in:
Andreas Källberg
2022-05-18 14:42:01 +08:00
parent ec70e4a83e
commit 9b9905c0b2

View File

@@ -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