Skip to content

Commit

Permalink
Attempt to fix binary issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoerzen committed Feb 16, 2012
1 parent 9bda7c5 commit bd08d07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion FeedParser.hs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Data.Maybe.Utils
import Data.Char import Data.Char
import Data.Either.Utils import Data.Either.Utils
import Data.List import Data.List
import System.IO


data Item = Item {itemtitle :: String, data Item = Item {itemtitle :: String,
itemguid :: Maybe String, itemguid :: Maybe String,
Expand Down Expand Up @@ -68,7 +69,8 @@ item2ep pc item =


parse :: FilePath -> String -> IO (Either String Feed) parse :: FilePath -> String -> IO (Either String Feed)
parse fp name = parse fp name =
do c <- readFile fp do h <- openBinaryFile fp ReadMode
c <- hGetContents h
case xmlParse' name (unifrob c) of case xmlParse' name (unifrob c) of
Left x -> return (Left x) Left x -> return (Left x)
Right y -> Right y ->
Expand Down

0 comments on commit bd08d07

Please sign in to comment.