diff --git a/cabal2nix/CHANGELOG.md b/cabal2nix/CHANGELOG.md index 4a1755a54..72c15c904 100644 --- a/cabal2nix/CHANGELOG.md +++ b/cabal2nix/CHANGELOG.md @@ -1,5 +1,10 @@ # Revision History for cabal2nix +## Unreleased + +* `hackage2nix` now defaults internally to a utf-8 locale ignoring enviroment + variables. + ## 2.19.1 **Warning**: This version of `cabal2nix` generates Nix expressions that diff --git a/cabal2nix/hackage2nix/Main.hs b/cabal2nix/hackage2nix/Main.hs index 1916b1a5c..5c0b7f643 100644 --- a/cabal2nix/hackage2nix/Main.hs +++ b/cabal2nix/hackage2nix/Main.hs @@ -41,6 +41,7 @@ import Text.PrettyPrint.HughesPJClass hiding ( (<>) ) import Data.List.NonEmpty (NonEmpty) import Data.Semigroup (sconcat) import Options.Applicative.NonEmpty (some1) +import GHC.IO.Encoding (setLocaleEncoding) type PackageSet = Map PackageName Version type PackageMultiSet = Map PackageName (Set Version) @@ -56,6 +57,7 @@ data CLI = CLI main :: IO () main = do + setLocaleEncoding utf8 let cliOptions :: Parser CLI cliOptions = CLI <$> strOption (long "hackage" <> help "path to Hackage git repository" <> value "hackage" <> showDefaultWith id <> metavar "PATH")