From f98f101a67df9cdfcaa79a154afaa8102210275d Mon Sep 17 00:00:00 2001 From: Alec Theriault Date: Tue, 16 Oct 2018 16:50:14 -0700 Subject: Set UTF-8 encoding before writing files (#934) This should fix #929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). --- haddock-api/src/Haddock/Backends/LaTeX.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'haddock-api/src/Haddock/Backends/LaTeX.hs') diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 0c7747bd..d2baf69a 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -135,7 +135,7 @@ ppLaTeXTop doctitle packageStr odir prologue maybe_style ifaces = do filename = odir (fromMaybe "haddock" packageStr <.> "tex") - writeFile filename (show tex) + writeUtf8File filename (show tex) ppLaTeXModule :: String -> FilePath -> Interface -> IO () @@ -168,7 +168,7 @@ ppLaTeXModule _title odir iface = do body = processExports exports -- - writeFile (odir moduleLaTeXFile mdl) (fullRender PageMode 80 1 txtPrinter "" tex) + writeUtf8File (odir moduleLaTeXFile mdl) (fullRender PageMode 80 1 txtPrinter "" tex) -- | Prints out an entry in a module export list. exportListItem :: ExportItem DocNameI -> LaTeX -- cgit v1.2.3