diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-07-13 15:56:41 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-07-13 17:20:11 +0000 |
commit | 955b20d81affb9082f97e0726625c40ce9f38866 (patch) | |
tree | 4f350dba2e239cc4e7b7bdc937736d642919dc7e | |
parent | a179db327c739f3580cf11201b1f6c8520bc2dcb (diff) |
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@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rwxr-xr-x | scripting/source/pyprov/mailmerge.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py index f70f034c3569..af10dbe4a967 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') |