UI/EmailDialog.py

changeset 45
9a18f4dbb493
parent 42
23b45a742e17
child 97
c4086afea02b
--- a/UI/EmailDialog.py	Sun Jan 10 13:59:15 2010 +0000
+++ b/UI/EmailDialog.py	Sun Jan 10 19:19:52 2010 +0000
@@ -28,9 +28,12 @@
 ############################################################
 from base64 import b64encode as _bencode
 def _encode_base64(msg):
-    """Encode the message's payload in Base64.
+    """
+    Function to encode the message's payload in Base64.
 
-    Also, add an appropriate Content-Transfer-Encoding header.
+    Note: It adds an appropriate Content-Transfer-Encoding header.
+    
+    @param msg reference to the message object (email.Message)
     """
     orig = msg.get_payload()
     encdata = str(_bencode(orig), "ASCII")
@@ -223,7 +226,8 @@
             name = os.path.basename(fname)
             
             if maintype == 'text':
-                att = MIMEText(open(fname, 'r').read(), _subtype = subtype)
+                att = MIMEText(
+                    open(fname, 'r', encoding = "utf-8").read(), _subtype = subtype)
             elif maintype == 'image':
                 att = MIMEImage(open(fname, 'rb').read(), _subtype = subtype)
             elif maintype == 'audio':

eric ide

mercurial