You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mail helper library breaks with unicode recipient names #334
I encountered an issue using the helper library to send mails to recipients with unicode first name / last name:
File "/usr/local/lib/python2.7/dist-packages/sendgrid/helpers/mail/mail.py", line 379, in __init__ self.value = value File "/usr/local/lib/python2.7/dist-packages/sendgrid/helpers/mail/mail.py", line 395, in value self._value = str(value) UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
Activity
thinkingserious commentedon Aug 17, 2017
Thanks for the heads up. I've added this to our backlog.
For my own reference, I think this should do the trick:
self._value = str(value).encode('utf-8')For this issue to gain priority in our backlog, we need additional +1's or a PR. When we receive a PR, that provides the biggest jump in priority.
thinkingserious commentedon Aug 17, 2017
@mehronkugler,
Do you mind providing some sample content that is causing the breakage? Thanks!