Permalink
Browse files

Change readFileUTF8 so it doesn't encode filename on ghc 7.4.

  • Loading branch information...
1 parent 2215c8f commit cc8b1a7e2b673cd5e521c7311fa3971f027a1f4a John MacFarlane committed May 16, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 Network/Gitit/Util.hs
View
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-
Copyright (C) 2009 John MacFarlane <jgm@berkeley.edu>
This program is free software; you can redistribute it and/or modify
@@ -40,7 +41,11 @@ import Codec.Binary.UTF8.String (encodeString)
-- | Read file as UTF-8 string. Encode filename as UTF-8.
readFileUTF8 :: FilePath -> IO String
+#if MIN_VERSION_base(4,5,0)
+readFileUTF8 f = liftM toString $ B.readFile f
+#else
readFileUTF8 f = liftM toString $ B.readFile $ encodeString f
+#endif
-- | Perform a function a directory and return to working directory.
inDir :: FilePath -> IO a -> IO a

0 comments on commit cc8b1a7

Please sign in to comment.