Decode the subject using its real given charset

This commit is contained in:
László Károlyi 2015-05-26 18:21:58 +02:00
parent 6c685fb181
commit c26f810527
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ def remove_spam_flag(subject):
# Mystical, sometimes it's bytes, sometimes str, handle that
item_zero = item[0]
if type(item_zero) is bytes:
item_zero = item_zero.decode(encoding_result['encoding'])
item_zero = item_zero.decode(item[1])
result += (
item_zero.replace('*****SPAM***** ', ''),
item[1]), # Note it's a tuple