Index: django/conf/project_template/settings.py
===================================================================
--- django/conf/project_template/settings.py	(revision 1476)
+++ django/conf/project_template/settings.py	(working copy)
@@ -15,6 +15,8 @@
 DATABASE_PASSWORD = ''         # Not used with sqlite3.
 DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
 DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
+DATABASE_ENCODING = ''         # Set to encoding name used by your database
+                               # (i.e. 'utf8' for MySQL or 'unicode' for Postgres). Not used with sqlite3.
 
 # Local time zone for this installation. All choices can be found here:
 # http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
Index: django/core/db/backends/postgresql.py
===================================================================
--- django/core/db/backends/postgresql.py	(revision 1476)
+++ django/core/db/backends/postgresql.py	(working copy)
@@ -15,7 +15,7 @@
         self.queries = []
 
     def cursor(self):
-        from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DEBUG, TIME_ZONE
+        from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DATABASE_ENCODING, DEBUG, TIME_ZONE
         if self.connection is None:
             if DATABASE_NAME == '':
                 from django.core.exceptions import ImproperlyConfigured
@@ -31,6 +31,10 @@
                 conn_string += " port=%s" % DATABASE_PORT
             self.connection = Database.connect(conn_string)
             self.connection.set_isolation_level(1) # make transactions transparent to all cursors
+            
+            if DATABASE_ENCODING:
+              self.connection.cursor().execute("SET CLIENT_ENCODING TO "+DATABASE_ENCODING)
+
         cursor = self.connection.cursor()
         cursor.execute("SET TIME ZONE %s", [TIME_ZONE])
         if DEBUG:
Index: django/core/db/backends/mysql.py
===================================================================
--- django/core/db/backends/mysql.py	(revision 1476)
+++ django/core/db/backends/mysql.py	(working copy)
@@ -53,7 +53,7 @@
         self.queries = []
 
     def cursor(self):
-        from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DEBUG
+        from django.conf.settings import DATABASE_USER, DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, DATABASE_PASSWORD, DATABASE_ENCODING, DEBUG
         if self.connection is None:
             kwargs = {
                 'user': DATABASE_USER,
@@ -65,6 +65,10 @@
             if DATABASE_PORT:
                 kwargs['port'] = DATABASE_PORT
             self.connection = Database.connect(**kwargs)
+
+        if DATABASE_ENCODING:
+          self.connection.cursor().execute("SET NAMES "+DATABASE_ENCODING)
+  
         if DEBUG:
             return base.CursorDebugWrapper(MysqlDebugWrapper(self.connection.cursor()), self)
         return self.connection.cursor()
