iUsing codecs to read the UTF-8 correctly. - zs - Zeitungsschau rss to email converter Err gopher.r-36.net 70 i Err gopher.r-36.net 70 1Log /scm/zs//log.gph gopher.r-36.net 70 1Files /scm/zs//files.gph gopher.r-36.net 70 1Refs /scm/zs//refs.gph gopher.r-36.net 70 1LICENSE /scm/zs//file/LICENSE.gph gopher.r-36.net 70 i--- Err gopher.r-36.net 70 1commit 74d725025a8b3d9409fb744fd237558387eada47 /scm/zs//commit/74d725025a8b3d9409fb744fd237558387eada47.gph gopher.r-36.net 70 1parent 61f5d5bbba7c474b4a7188f448cf9cbac9479485 /scm/zs//commit/61f5d5bbba7c474b4a7188f448cf9cbac9479485.gph gopher.r-36.net 70 hAuthor: Christoph Lohmann <20h@r-36.net> URL:mailto:20h@r-36.net gopher.r-36.net 70 iDate: Sun, 25 Oct 2015 11:29:16 +0100 Err gopher.r-36.net 70 i Err gopher.r-36.net 70 iUsing codecs to read the UTF-8 correctly. Err gopher.r-36.net 70 i Err gopher.r-36.net 70 iDiffstat: Err gopher.r-36.net 70 i zeitungsschau/feed.py | 3 ++- Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i1 file changed, 2 insertions(+), 1 deletion(-) Err gopher.r-36.net 70 i--- Err gopher.r-36.net 70 1diff --git a/zeitungsschau/feed.py b/zeitungsschau/feed.py /scm/zs//file/zeitungsschau/feed.py.gph gopher.r-36.net 70 i@@ -12,6 +12,7 @@ import dateutil.parser Err gopher.r-36.net 70 i import requests Err gopher.r-36.net 70 i import hashlib Err gopher.r-36.net 70 i import pytz Err gopher.r-36.net 70 i+import codecs Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i def parseiso(dstr, now): Err gopher.r-36.net 70 i return dateutil.parser.parse(str(dstr), default=now) Err gopher.r-36.net 70 i@@ -230,7 +231,7 @@ def parse(astr): Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i def fetch(uri): Err gopher.r-36.net 70 i if "file://" in uri: Err gopher.r-36.net 70 i- fd = open(uri[7:], "r") Err gopher.r-36.net 70 i+ fd = codecs.open(uri[7:], "r", "utf-8") Err gopher.r-36.net 70 i fval = fd.read().encode("utf-8") Err gopher.r-36.net 70 i fd.close() Err gopher.r-36.net 70 i rcode = 200 Err gopher.r-36.net 70 .