]> git.phdru.name Git - mimedecode.git/blobdiff - mimedecode.py
Inline recode
[mimedecode.git] / mimedecode.py
index 1006fb47768d8c9efc6c225eab9e8ebead50c2c9..e63aedcc8664c82bdf89ae915d3ac59666e2c4a0 100755 (executable)
@@ -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