summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2021-12-20 17:14:13 +0100
committerstuebinm2021-12-20 17:14:13 +0100
commit3a9af9322c1348b03034b80fb11b5a22e3b811a2 (patch)
tree663740a0b501d14be42cd51aeff77995cab8b8e6
parent65e496a811002af9948d0453675567c9eaf827d9 (diff)
turns out apparently C8.unpack assumes ascii
(and no one's documented that) Anyways it now uses utf8 which seems a little more reasonable.
-rw-r--r--src/Main.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 7415e18..32afb6a 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -11,8 +11,9 @@ import Control.Monad.Identity (Identity)
import Data.Aeson (eitherDecode, encode)
import Data.Aeson.Encode.Pretty (encodePretty)
import Data.Aeson.KeyMap (coercionToHashMap)
-import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString.Lazy as LB
+import qualified Data.Text.Encoding as T
+import qualified Data.Text.IO as T
import Data.Maybe (fromMaybe)
import System.Exit (ExitCode (..), exitWith)
import WithCli
@@ -88,7 +89,7 @@ run options = do
-- | haskell's many string types are FUN …
printLB :: LB.ByteString -> IO ()
-printLB a = putStrLn $ C8.unpack $ LB.toStrict a
+printLB a = T.putStrLn $ T.decodeUtf8 $ LB.toStrict a
-- if Aesons's internal map and HashMap are the same type, then coercionToHashMap