From 6be4ebdeb240928cc280232fe832a6a86a4e03b7 Mon Sep 17 00:00:00 2001 From: maralorn Date: Wed, 31 Jan 2024 23:51:11 +0100 Subject: [PATCH 1/2] Make hackage2nix locale independent --- cabal2nix/hackage2nix/Main.hs | 2 ++ 1 file changed, 2 insertions(+) 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") From d0b586183e0c200a714982ecc5474bb52cc077ac Mon Sep 17 00:00:00 2001 From: maralorn Date: Mon, 5 Feb 2024 23:24:43 +0100 Subject: [PATCH 2/2] Add entry to changelog --- cabal2nix/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) 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