Closed gene1wood closed 3 years ago
If initial_email_reply contains UTF-8 characters, then these lines cause an error
initial_email_reply
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 361: ordinal not in range(128)
This could be fixed by changing these to
part1 = MIMEText(text, 'plain', _charset="UTF-8") part2 = MIMEText(html, 'html', _charset="UTF-8")
however then even if the payload isn't unicode it gets encoded which isn't ideal.
Is there a way to detect if text contains non ascii characters and only encode if it does?
text
Fixed in #36
If
initial_email_reply
contains UTF-8 characters, then these lines cause an errorThis could be fixed by changing these to
however then even if the payload isn't unicode it gets encoded which isn't ideal.
Is there a way to detect if
text
contains non ascii characters and only encode if it does?