Fix the "Invalid or incomplete multibyte or wide character" error
caused by some feeds: set binary mode on the handle before hGetContents (upstream git commit bd08d07cc29893177efe8ef0e8be368657d56bbf)
This commit is contained in:
parent
55cc1870f7
commit
724526e05c
@ -1,9 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.19 2011/12/27 21:24:23 kili Exp $
|
||||
# $OpenBSD: Makefile,v 1.20 2012/03/20 13:33:54 dcoppa Exp $
|
||||
|
||||
COMMENT = command line podcast aggregator
|
||||
|
||||
DISTNAME = hpodder-1.1.6
|
||||
REVISION = 0
|
||||
REVISION = 1
|
||||
CATEGORIES = net
|
||||
HOMEPAGE = http://wiki.github.com/jgoerzen/hpodder/
|
||||
|
||||
|
26
net/hpodder/patches/patch-FeedParser_hs
Normal file
26
net/hpodder/patches/patch-FeedParser_hs
Normal file
@ -0,0 +1,26 @@
|
||||
$OpenBSD: patch-FeedParser_hs,v 1.4 2012/03/20 13:33:54 dcoppa Exp $
|
||||
|
||||
Fix the "Invalid or incomplete multibyte or wide character" error
|
||||
caused by some feeds: set binary mode on the handle before hGetContents
|
||||
(upstream git commit bd08d07cc29893177efe8ef0e8be368657d56bbf)
|
||||
|
||||
--- FeedParser.hs.orig Tue Nov 8 16:49:38 2011
|
||||
+++ FeedParser.hs Tue Mar 20 14:08:25 2012
|
||||
@@ -39,6 +39,7 @@ import Data.Maybe.Utils
|
||||
import Data.Char
|
||||
import Data.Either.Utils
|
||||
import Data.List
|
||||
+import System.IO
|
||||
|
||||
data Item = Item {itemtitle :: String,
|
||||
itemguid :: Maybe String,
|
||||
@@ -68,7 +69,8 @@ item2ep pc item =
|
||||
|
||||
parse :: FilePath -> String -> IO (Either String Feed)
|
||||
parse fp name =
|
||||
- do c <- readFile fp
|
||||
+ do h <- openBinaryFile fp ReadMode
|
||||
+ c <- hGetContents h
|
||||
case xmlParse' name (unifrob c) of
|
||||
Left x -> return (Left x)
|
||||
Right y ->
|
Loading…
x
Reference in New Issue
Block a user