[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - scripting/source
Caolán McNamara
caolanm at redhat.com
Sat Jul 13 10:20:35 PDT 2013
scripting/source/pyprov/mailmerge.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 955b20d81affb9082f97e0726625c40ce9f38866
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
(cherry picked from commit c4aa13c931da11164835a7aafbfd7e44bd5714ca)
Reviewed-on: https://gerrit.libreoffice.org/4884
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at 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')
More information about the Libreoffice-commits
mailing list