From: Oleg Broytman Date: Thu, 13 Mar 2014 00:00:59 +0000 (+0400) Subject: Inline recode X-Git-Tag: v2.5.0~16 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=34ad6ae1312194ecb89c3ec482f888b8bd05754a;p=mimedecode.git Inline recode --- diff --git a/mimedecode.py b/mimedecode.py index 1006fb4..e63aedc 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -34,12 +34,9 @@ def output_headers(msg): output("\n") # End of headers -def recode(s, charset): - return unicode(s, charset, "replace").encode(g.default_encoding, "replace") - def recode_if_needed(s, charset): if charset and charset.lower() <> g.default_encoding: - s = recode(s, charset) + s = unicode(s, charset, "replace").encode(g.default_encoding, "replace") return s