From f2ee2ceb2c7d5ba1b3e0c8f03a3b2d03939a2252 Mon Sep 17 00:00:00 2001
From: Julien Marquet <j@recursor.wf>
Date: Thu, 28 Apr 2022 16:14:54 +0200
Subject: [PATCH] Encoding issues

---
 .gitignore      |  1 +
 ssg/src/Main.hs | 19 +++++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/.gitignore b/.gitignore
index 34e921e..5f565d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 ssg/dist-newstyle
 src/_cache
 src/_site
+result
diff --git a/ssg/src/Main.hs b/ssg/src/Main.hs
index dd8e4e0..4be802c 100644
--- a/ssg/src/Main.hs
+++ b/ssg/src/Main.hs
@@ -1,17 +1,20 @@
 {-# LANGUAGE OverloadedStrings #-}
 
 import Data.Maybe (fromMaybe)
+import qualified GHC.IO.Encoding as E
 
 import Hakyll
 
 main :: IO ()
-main = hakyll $ do
-  match "templates/*" $
-    compile templateBodyCompiler
+main = do
+  E.setLocaleEncoding E.utf8
+  hakyll $ do
+    match "templates/*" $
+      compile templateBodyCompiler
 
-  match "index.md" $ do
-    route $ constRoute "index.html" 
-    compile $
-      pandocCompiler
-        >>= loadAndApplyTemplate "templates/default.html" defaultContext
+    match "index.md" $ do
+      route $ constRoute "index.html" 
+      compile $
+        pandocCompiler
+          >>= loadAndApplyTemplate "templates/default.html" defaultContext