#1676 Unicode in comment errors when trying to send email

v1.0.0
closed
Wolf
sf-1 (616)
General
nobody
2015-08-20
2011-03-08
No

Let's make a test & fix.

Module forgemail.reactors.common_react:117 in send_email
<<              else:
                       addrs_multi.append(addr)
           plain_msg = util.encode_email_part(data['text'], 'plain')
           html_text = g.forge_markdown(email=True).convert(data['text'])
           html_msg = util.encode_email_part(html_text, 'html')
>>  plain_msg = util.encode_email_part(data['text'], 'plain')
Module forgemail.lib.util:105 in encode_email_part
<<          return MIMEText(content.encode('iso-8859-1'), content_type, 'iso-8859-1')
           except:
               return MIMEText(content.encode('latin-1'), content_type, 'utf-8')

       def make_multipart_message(*parts):
>>  return MIMEText(content.encode('latin-1'), content_type, 'utf-8')
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2193' in position 47: ordinal not in range(256)

Discussion

  • Dave Brondsema

    Dave Brondsema - 2011-03-09
    • size: --> 1
     
  • Dave Brondsema

    Dave Brondsema - 2011-03-18
    • status: open --> in-progress
    • assigned_to: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2011-03-18

    forge:db/1676

    • just code/test review
    • I don't know how to get a sandbox to reliably send an email yet, so skip manual testing (you can set to validation status instead of closed, if you want)
    • but I did copy the generated message text from the unit test, save it as a .eml file and open it in thunderbird
     
  • Dave Brondsema

    Dave Brondsema - 2011-03-18
    • status: in-progress --> code-review
    • assigned_to: Dave Brondsema --> Wolf
     
  • Wolf - 2011-03-21
    • status: code-review --> validation
     
  • Dave Brondsema

    Dave Brondsema - 2011-03-24
    • status: validation --> closed
     
  • Dave Brondsema

    Dave Brondsema - 2011-03-24

    works for me

     

Log in to post a comment.