Greetings,
I have set my MySQL to use utf8-unicode-ci, but Drupal keeps creating tables and fields using utf-general-ci.
Is there somewhere to set Drupal to use utf8-unicode-ci?
I have had a look in the forums and bug databases, and this is comes up a lot with modules. Basically the response is that it is a database issue, and not a module issue, so it gets closed.
I have tried both the following into my database.mysql.inc file, but it does not help:
// Force UTF-8.
// mysql_query('SET NAMES "utf8"', $connection);
mysql_query('SET NAMES "UTF8"', $connection);
mysql_query("SET collation_connection='utf8_unicode_ci'", $connection);
mysql_query("SET collation_server='utf8_unicode_ci'", $connection);
mysql_query("SET character_set_client='utf8'", $connection);
mysql_query("SET character_set_connection='utf8'", $connection);
mysql_query("SET character_set_results='utf8'", $connection);
mysql_query("SET character_set_server='utf8'", $connection);
And
// Force UTF-8.
// mysql_query('SET NAMES "utf8"', $connection);
mysql_query('SET NAMES "UTF8" COLLATE "utf8_unicode_ci"', $connection);
Any ideas on this? It is driving me nuts.
Don
Comments
I don't think core Drupal
I don't think core Drupal forces any collation. Some modules may be doing that for their own tables, specifying utf8_general_ci. Does the problem happen with *all* new tables or only some?
A MySQL database (4.1 or newer) supports a default collation for the database, a default collation for each table (which can be changed for specific tables) and also collations for individual columns in a tables.
I would check:
(a) What is the database's default collation, which will be used for new tables when no collation is specified. In phpmyadmin, you can see or change it in the "Operations" tab of the database view.
(b) Whether those tables are created by a module which does specify a collation.
----- Edited to add:
I forgot to ask, what Drupal version is that?
collation is set differently only on some tables
I've the same problem, which I made note of here:
http://drupal.org/node/298820#comment-1307014
I'm using drupal 6.9.