Skip to content

Commit

Permalink
Check if sys.stdout.encoding has any value, default to utf-8.
Browse files Browse the repository at this point in the history
  • Loading branch information
Albin Stjerna committed Nov 17, 2012
1 parent c428bd1 commit df01411
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sluk.py
Expand Up @@ -280,7 +280,11 @@ def update_feeds(update_feed_name=u"All"):
continue

if bodyfilter:
content = unicode(commands.getoutput(conf.get("filters", bodyfilter).replace("{url}", link)), encoding=sys.stdout.encoding)
if sys.stdout.encoding != None:
enc = sys.stdout.encoding
else:
enc = "utf-8"
content = unicode(commands.getoutput(conf.get("filters", bodyfilter).replace("{url}", link)), encoding=enc)

# We're encoding everything as utf-8 explicitly, because sadly, the MIME module won't do that for us.

Expand Down

0 comments on commit df01411

Please sign in to comment.