--- email-2.5.6/email/Header.py. 2005-06-07 17:47:35 +0400 +++ email-2.5.6/email/Header.py 2005-06-07 17:47:37 +0400 @@ -260,6 +260,9 @@ charset = self._charset elif not isinstance(charset, Charset): charset = Charset(charset) + # if charset is fail + if charset == 'us-ascii' and email.Generator._is8bitstring(s): + s = email.quopriMIME.header_encode(s) # If the charset is our faux 8bit charset, leave the string unchanged if charset <> '8bit': # We need to test that the string can be converted to unicode and --- email-2.5.6/email/base64MIME.py. 2005-06-07 17:47:44 +0400 +++ email-2.5.6/email/base64MIME.py 2005-06-07 17:48:12 +0400 @@ -173,7 +173,7 @@ if not s: return s - dec = a2b_base64(s) + dec = a2b_base64(s + "==") if convert_eols: return dec.replace(CRLF, convert_eols) return dec