diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2018-10-16 16:50:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-16 16:50:14 -0700 |
commit | f98f101a67df9cdfcaa79a154afaa8102210275d (patch) | |
tree | d5a76c393ea17004e5c5e73741acda1603b39477 /haddock-api/src/Haddock/Backends/Hyperlinker.hs | |
parent | a631fb6c15de83042e9739285518fda72cfb3144 (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/Hyperlinker.hs')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Hyperlinker.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index 248a8a54..8f0c4b67 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -6,6 +6,7 @@ module Haddock.Backends.Hyperlinker import Haddock.Types +import Haddock.Utils (writeUtf8File) import Haddock.Backends.Hyperlinker.Renderer import Haddock.Backends.Hyperlinker.Types import Haddock.Backends.Hyperlinker.Utils @@ -44,7 +45,7 @@ ppHyperlinkedModuleSource :: FilePath -> Bool -> SrcMap -> Interface -> IO () ppHyperlinkedModuleSource srcdir pretty srcs iface = case ifaceTokenizedSrc iface of - Just tokens -> writeFile path . html . render' $ tokens + Just tokens -> writeUtf8File path . html . render' $ tokens Nothing -> return () where render' = render (Just srcCssFile) (Just highlightScript) srcs |