diff options
Diffstat (limited to 'src/Haddock/Backends/Hoogle.hs')
-rw-r--r-- | src/Haddock/Backends/Hoogle.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index b9296be5..e4415db9 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -26,7 +26,7 @@ import Data.Char import Data.List import Data.Maybe import System.FilePath - +import System.IO prefix :: [String] prefix = ["-- Hoogle documentation, generated by Haddock" @@ -42,8 +42,10 @@ ppHoogle package version synopsis prologue ifaces odir = do ["@package " ++ package] ++ ["@version " ++ version | version /= ""] ++ concat [ppModule i | i <- ifaces, OptHide `notElem` ifaceOptions i] - writeFile (odir </> filename) (unlines contents) - + h <- openFile (odir </> filename) WriteMode + hSetEncoding h utf8 + hPutStr h (unlines contents) + hClose h ppModule :: Interface -> [String] ppModule iface = "" : doc (ifaceDoc iface) ++ |