Re: send_mail UnicodeDecodeError: 'ascii' codec can't decode byte
it should work with:
body = unicode("Treść", 'utf-8')
On Mar 14, 3:49 pm, Michał Klich <mic...@michalklich.com> wrote:
> Hi,
> I do not fully understand how this works.
>
> I have
> subject = "Temat"
> body = "Treść"
> from = some.em...@dot.com
> to = some.em...@dot.com
>
> send_email(subject, body, from, to) prints out
>
> Traceback (most recent call last):
> File "/usr/lib64/python2.6/logging/__init__.py", line 773, in emit
> stream.write(fs % msg.encode("UTF-8"))
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position
> 35: ordinal not in range(128)
>
> But why? I tried to unicode(body, "utf-8") and pass it but it would
> fail. I am obviously doing something wrong.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home