Code

Eudora can't handle utf-8 headers. We love Eudora. (sf bug 900046)
[roundup.git] / roundup / rfc2822.py
index a54d34f3371ac1ac3b201b31a23f9425e3337af7..8fba2ad819de83f806b61960f6819063f5392d27 100644 (file)
@@ -119,7 +119,7 @@ def decode_header(hdr):
         outs += unicode(section[0], charset or 'iso-8859-1', 'replace')
     return outs.encode('utf-8')
 
-def encode_header(header):
+def encode_header(header, charset='utf-8'):
     """ Will encode in quoted-printable encoding only if header 
     contains non latin characters
     """
@@ -132,7 +132,6 @@ def encode_header(header):
     if hqre.match(header):
         return header
     
-    charset = 'utf-8'
     quoted = ''
     #max_encoded = 76 - len(charset) - 7
     for c in header: