title: Django utf-8 and django-mailer strangeness
body: <p>Latest django mailer from trunk <a href="http://github.com/jtauber/django-mailer/tree/master/docs/" rel="nofollow noreferrer">http://github.com/jtauber/django-mailer/tree/master/docs/</a></p>
  
  <p>Tested with Postgresql 8.4, sqlite3</p>
  
  <h1>template</h1>
  
  <pre><code>{{ title }}
  </code></pre>
  
  <h1>forms.py</h1>
  
  <pre><code>#-*- coding: utf-8 -*-
  
  if "mailer" in settings.INSTALLED_APPS:
      from mailer import send_mail
  else:
      from django.core.mail import send_mail
  
  
  ...
          body_txt = render_to_string(
              'mails/share_deal/email_body.txt',
              {
  
                  'title':u"éééààà",
  
              }
          )
  
          send_mail( "",  body_txt , "foo@ff.ff",  ["bar@kl.fd"],  fail_silently=True)
  </code></pre>
  
  <h1>Error</h1>
  
  <p>Environment:</p>
  
  <p>Request Method: POST
  Request URL: <a href="http://localhost:8000/deals/share/" rel="nofollow noreferrer">http://localhost:8000/deals/share/</a>
  Django Version: 1.2 SVN-13596
  Python Version: 2.6.5
  Installed Applications:
  ['django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.sites',
   'django.contrib.messages',
   'django.contrib.admin',
   'django_extensions',
   'django.contrib.markup',
   'django.contrib.comments',
   'ajaxcomments',
   'mailer',
   'profiles',
   'tagging',
   'wmd',
   'core',
   'deals']
  Installed Middleware:
  ('django.middleware.common.CommonMiddleware',
   'django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware')</p>
  
  <pre><code>Traceback:
  File "/home/gregory/.virtualenvs/alpha/src/django/django/core/handlers/base.py" in get_response
    100.                     response = callback(request, *callback_args, **callback_kwargs)
  File "/home/gregory/projects/casadeal/casadeal/core/decorators.py" in wrap
    12.         return f(request, *args, **kwargs)
  File "/home/gregory/.virtualenvs/alpha/src/django/django/views/decorators/http.py" in inner
    37.             return func(request, *args, **kwargs)
  File "/home/gregory/projects/casadeal/casadeal/deals/views.py" in share_deal
    22.             form.send_mail()
  File "/home/gregory/projects/casadeal/casadeal/deals/forms.py" in send_mail
    89.             fail_silently=True)
  File "/home/gregory/.virtualenvs/casadeal/src/django-mailer/mailer/__init__.py" in send_mail
    45.                  priority=priority).save()
  File "/home/gregory/.virtualenvs/alpha/src/django/django/db/models/base.py" in save
    435.         self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/gregory/.virtualenvs/alpha/src/django/django/db/models/base.py" in save_base
    528.                     result = manager._insert(values, return_id=update_pk, using=using)
  File "/home/gregory/.virtualenvs/alpha/src/django/django/db/models/manager.py" in _insert
    195.         return insert_query(self.model, values, **kwargs)
  File "/home/gregory/.virtualenvs/alpha/src/django/django/db/models/query.py" in insert_query
    1479.     return query.get_compiler(using=using).execute_sql(return_id)
  File "/home/gregory/.virtualenvs/alpha/src/django/django/db/models/sql/compiler.py" in execute_sql
    783.         cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/home/gregory/.virtualenvs/alpha/src/django/django/db/models/sql/compiler.py" in execute_sql
    727.         cursor.execute(sql, params)
  File "/home/gregory/.virtualenvs/alpha/src/django/django/db/backends/util.py" in execute
    15.             return self.cursor.execute(sql, params)
  File "/home/gregory/.virtualenvs/alpha/src/django/django/db/backends/postgresql_psycopg2/base.py" in execute
    44.             return self.cursor.execute(query, args)
  
  Exception Type: DatabaseError at /deals/share/
  Exception Value: ERREUR:  séquence d'octets invalide pour l'encodage « UTF8 » : 0xe9e9e9
  HINT:  Cette erreur peut aussi survenir si la séquence d'octets ne correspond pas
  au jeu de caractères attendu par le serveur, le jeu étant contrôlé par
  « client_encoding ».
  
  Basically it says that the encoding was not valid for UTF8 and contained   0xe9e9e9
  </code></pre>
  
  <p>This seems quite strange,</p>
  
  <p>Any hints on where it could come from ?</p>