From 86a3be291b61897ac05fc2a5e378b24720d157aa Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 5 Jan 2011 18:24:27 +0000 Subject: Write hoogle output in utf8; fixes GHC build on Windows --- src/Haddock/Backends/Hoogle.hs | 8 +++++--- 1 file 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) ++ -- cgit v1.2.3