Index: includes/update.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/update.inc,v
retrieving revision 1.42
diff -u -p -r1.42 update.inc
--- includes/update.inc	11 Apr 2010 17:16:45 -0000	1.42
+++ includes/update.inc	16 Apr 2010 00:22:16 -0000
@@ -671,6 +671,11 @@ function update_parse_db_url($db_url) {
       'host' => urldecode($url['host']),
       'port' => isset($url['port']) ? urldecode($url['port']) : '',
     );
+    // Determine default database collation. Borrowed from PMA.
+    $collation = db_query('SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = :database', array(':database' => $databases[$database]['default']['database']))->fetchField();
+    if ($collation) {
+      $databases[$database]['default']['default_collation'] = $collation;
+    }
   }
   return $databases;
 }
Index: includes/database/mysql/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/mysql/database.inc,v
retrieving revision 1.26
diff -u -p -r1.26 database.inc
--- includes/database/mysql/database.inc	7 Mar 2010 08:03:44 -0000	1.26
+++ includes/database/mysql/database.inc	16 Apr 2010 01:09:21 -0000
@@ -25,6 +25,10 @@ class DatabaseConnection_mysql extends D
       $connection_options['port'] = 3306;
     }
 
+    if (empty($connection_options['default_collation'])) {
+      $connection_options['default_collation'] = 'utf8_unicode_ci';
+    }
+
     $this->connectionOptions = $connection_options;
 
     $dsn = 'mysql:host=' . $connection_options['host'] . ';port=' . $connection_options['port'] . ';dbname=' . $connection_options['database'];
@@ -38,7 +42,7 @@ class DatabaseConnection_mysql extends D
     ));
 
     // Force MySQL to use the UTF-8 character set by default.
-    $this->exec('SET NAMES "utf8"');
+    $this->exec('SET NAMES utf8 COLLATE ' . $connection_options['default_collation']);
 
     // Force MySQL's behavior to conform more closely to SQL standards.
     // This allows Drupal to run almost seamlessly on many different
Index: includes/database/mysql/schema.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/mysql/schema.inc,v
retrieving revision 1.36
diff -u -p -r1.36 schema.inc
--- includes/database/mysql/schema.inc	7 Apr 2010 15:07:59 -0000	1.36
+++ includes/database/mysql/schema.inc	16 Apr 2010 01:06:02 -0000
@@ -74,10 +74,11 @@ class DatabaseSchema_mysql extends Datab
    *   An array of SQL statements to create the table.
    */
   protected function createTableSql($name, $table) {
-    // Provide some defaults if needed
+    // Provide some defaults if needed.
     $table += array(
       'mysql_engine' => 'InnoDB',
-      'mysql_character_set' => 'UTF8',
+      'mysql_character_set' => 'utf8',
+      'mysql_collation' => $this->connection->default_collation,
     );
 
     $sql = "CREATE TABLE {" . $name . "} (\n";
@@ -96,7 +97,13 @@ class DatabaseSchema_mysql extends Datab
     // Remove the last comma and space.
     $sql = substr($sql, 0, -3) . "\n) ";
 
-    $sql .= 'ENGINE = ' . $table['mysql_engine'] . ' DEFAULT CHARACTER SET ' . $table['mysql_character_set'];
+    $sql .= 'ENGINE = ' . $table['mysql_engine'];
+
+    // Only add a character set, if set. By default, MySQL uses the default
+    // database collation for new tables.
+    if (!empty($table['mysql_character_set'])) {
+      $sql .= ' DEFAULT CHARACTER SET ' . $table['mysql_character_set'] . ' COLLATE ' . $table['mysql_collation'];
+    }
 
     // Add table comment.
     if (!empty($table['description'])) {
Index: sites/default/default.settings.php
===================================================================
RCS file: /cvs/drupal/drupal/sites/default/default.settings.php,v
retrieving revision 1.44
diff -u -p -r1.44 default.settings.php
--- sites/default/default.settings.php	7 Apr 2010 15:07:59 -0000	1.44
+++ sites/default/default.settings.php	16 Apr 2010 01:10:00 -0000
@@ -61,6 +61,7 @@
  *   'password' => 'password',
  *   'host' => 'localhost',
  *   'port' => 3306,
+ *   'default_collation' => 'utf8_unicode_ci',
  * );
  *
  * The "driver" property indicates what Drupal database driver the
