aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Hoogle.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-01-05 18:24:27 +0000
committerIan Lynagh <igloo@earth.li>2011-01-05 18:24:27 +0000
commit86a3be291b61897ac05fc2a5e378b24720d157aa (patch)
treedd3af7bd6d63ec0166bddbf907ea6a7569c4b23c /src/Haddock/Backends/Hoogle.hs
parent395cc6c2ecf917f100c1772b439ccf12faf9c6b8 (diff)
Write hoogle output in utf8; fixes GHC build on Windows
Diffstat (limited to 'src/Haddock/Backends/Hoogle.hs')
-rw-r--r--src/Haddock/Backends/Hoogle.hs8
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) ++