[Libreoffice-commits] core.git: scripting/source

Caolán McNamara caolanm at redhat.com
Sat Jul 13 07:59:57 PDT 2013


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

New commits:
commit c4aa13c931da11164835a7aafbfd7e44bd5714ca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 13 15:56:41 2013 +0100

    Resolves: fdo#66761 Macro controlled Python Mailmerge broken
    
    Change-Id: Id8bbf06a5571534aa5eef8624e89565fe3715938

diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py
index cbd1428..6fa486d 100755
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
@@ -182,7 +182,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')


More information about the Libreoffice-commits mailing list