Permalink
Browse files

Check if sys.stdout.encoding has any value, default to utf-8.

  • Loading branch information...
1 parent c428bd1 commit df01411b1d5a558db49f359b6ebb3dd1ccdd6122 Albin Stjerna committed Nov 17, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 sluk.py
View
@@ -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.

0 comments on commit df01411

Please sign in to comment.