I also recommend you to use Django's EmailMessage class and its derivatives [1], as they handle unicode perfectly; they also reduce your code for sending emails to a couple of lines, which is always good.
[1] http://www.djangoproject.com/documentation/email/#e-mail-messages On May 8, 3:26 am, oliver <[EMAIL PROTECTED]> wrote: > we use thishttp://www.djangosnippets.org/snippets/285/as a base and > made it work for us. templates are stored in the database so our users > can "edit" the html email and text email templates with a list of > "variables" they can use. > Works quite well .. and now even with out acii/unicode errors by the > looks of it. you can see most of the code for this in the dpast link > in my 1st message > > On 7 May, 13:23, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 07-May-08, at 12:49 PM, oliver wrote: > > > > Now this all works fine till I get a non English PC using this (the > > > error below is from our very basic contact form!) > > > > Exception Type: UnicodeEncodeError at /contact-opal-students/ > > > Exception Value: 'ascii' codec can't encode character u'\xb4' in > > > position 88: ordinal not in range(128) > > > how do you compose your email? I had this problem even using > > postgresql when I tried to compose the email within the view by > > concatenating strings. I then set up a text template and passed > > variables to that - and the problem went away > > > -- > > > regards > > kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/code/ --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---