? term_lower.patch
Index: modules/taxonomy/taxonomy.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.install,v
retrieving revision 1.7
diff -u -p -r1.7 taxonomy.install
--- modules/taxonomy/taxonomy.install	8 Jan 2008 07:46:41 -0000	1.7
+++ modules/taxonomy/taxonomy.install	1 Jul 2008 13:27:54 -0000
@@ -28,6 +28,13 @@ function taxonomy_schema() {
         'default' => '',
         'description' => t('The term name.'),
       ),
+      'name_lower' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => t('Lowercase version of the term name for indexing.'),
+      ),
       'description' => array(
         'type' => 'text',
         'not null' => FALSE,
@@ -46,6 +53,7 @@ function taxonomy_schema() {
     'indexes' => array(
       'taxonomy_tree' => array('vid', 'weight', 'name'),
       'vid_name' => array('vid', 'name'),
+      'name_lower' => array('name_lower'),
     ),
   );
 
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.423
diff -u -p -r1.423 taxonomy.module
--- modules/taxonomy/taxonomy.module	28 Jun 2008 19:51:02 -0000	1.423
+++ modules/taxonomy/taxonomy.module	1 Jul 2008 13:27:55 -0000
@@ -300,6 +300,7 @@ function taxonomy_save_term(&$form_value
     'description' => '',
     'weight' => 0
   );
+  $form_values['name_lower'] = mb_strtolower($form_values['name'], 'UTF-8');
 
   if (!empty($form_values['tid']) && $form_values['name']) {
     drupal_write_record('term_data', $form_values, 'tid');
Index: modules/taxonomy/taxonomy.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v
retrieving revision 1.11
diff -u -p -r1.11 taxonomy.pages.inc
--- modules/taxonomy/taxonomy.pages.inc	14 Apr 2008 17:48:42 -0000	1.11
+++ modules/taxonomy/taxonomy.pages.inc	1 Jul 2008 13:27:55 -0000
@@ -119,7 +119,7 @@ function taxonomy_autocomplete($vid, $st
   $last_string = trim(array_pop($array));
   $matches = array();
   if ($last_string != '') {
-    $result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE t.vid = %d AND LOWER(t.name) LIKE LOWER('%%%s%%')", 't', 'tid'), $vid, $last_string, 0, 10);
+    $result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE t.vid = %d AND t.name_lower LIKE('%%%s%%')", 't', 'tid'), $vid, mb_strtolower($last_string, 'UTF-8'), 0, 10);
 
     $prefix = count($array) ? implode(', ', $array) . ', ' : '';
 
