aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/LaTeX.hs
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2018-10-16 16:50:14 -0700
committerGitHub <noreply@github.com>2018-10-16 16:50:14 -0700
commitf98f101a67df9cdfcaa79a154afaa8102210275d (patch)
treed5a76c393ea17004e5c5e73741acda1603b39477 /haddock-api/src/Haddock/Backends/LaTeX.hs
parenta631fb6c15de83042e9739285518fda72cfb3144 (diff)
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).
Diffstat (limited to 'haddock-api/src/Haddock/Backends/LaTeX.hs')
-rw-r--r--haddock-api/src/Haddock/Backends/LaTeX.hs4
1 files changed, 2 insertions, 2 deletions
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