scripting/source/pyprov/mailmerge.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 820fe067c0ede36f357fb214d0298e3caaff512f
Author: Caolán McNamara <caol...@redhat.com>
Date:   Sat Jul 13 15:56:41 2013 +0100

    Resolves: fdo#66761 Macro controlled Python Mailmerge broken
    
    Change-Id: Id8bbf06a5571534aa5eef8624e89565fe3715938
    (cherry picked from commit c4aa13c931da11164835a7aafbfd7e44bd5714ca)
    Reviewed-on: https://gerrit.libreoffice.org/4883
    Reviewed-by: Fridrich Strba <fridr...@documentfoundation.org>
    Tested-by: Fridrich Strba <fridr...@documentfoundation.org>

diff --git a/scripting/source/pyprov/mailmerge.py 
b/scripting/source/pyprov/mailmerge.py
index f70f034..af10dbe 100755
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
@@ -181,7 +181,10 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
                                        textmsg['Content-Type'] = mimeEncoding
                                        textmsg['MIME-Version'] = '1.0'
 
-                                       textbody = textbody.encode('utf-8')
+                                       try:
+                                               textbody = 
textbody.encode('utf-8')
+                                       except:
+                                               textbody = 
str(textbody.value).encode('utf-8')
                                        if sys.version >= '3':
                                                
#http://stackoverflow.com/questions/9403265/how-do-i-use-python-3-2-email-module-to-send-unicode-messages-encoded-in-utf-8-w
                                                textbody = 
textbody.decode('iso8859-1')
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to