=== modified file 'src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs'
--- src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	2009-02-26 20:04:55 +0000
+++ src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	2009-03-01 02:49:52 +0000
@@ -52,7 +52,7 @@
         // NOTE: Whenever there is a change in ANY of the database schema,
         //       this version MUST be incremented and a migration method
         //       MUST be supplied to match the new version number
-        protected const int CURRENT_VERSION = 25;
+        protected const int CURRENT_VERSION = 26;
         protected const int CURRENT_METADATA_VERSION = 5;
         
 #region Migration Driver
@@ -592,6 +592,17 @@
         
 #endregion
 
+#region Version 26
+
+        [DatabaseVersion (26)]
+        private bool Migrate_26 ()
+        {
+            // Update search keys for new space-stripping behavior.
+            return Migrate_24 ();
+        }
+
+#endregion
+
 #pragma warning restore 0169
         
 #region Fresh database setup

=== modified file 'src/Libraries/Hyena/Hyena/StringUtil.cs'
--- src/Libraries/Hyena/Hyena/StringUtil.cs	2009-02-26 20:04:55 +0000
+++ src/Libraries/Hyena/Hyena/StringUtil.cs	2009-03-01 20:10:24 +0000
@@ -184,17 +184,29 @@
             StringBuilder sb = new StringBuilder ();
             UnicodeCategory category;
             bool previous_was_latin = false;
+            bool got_space = false;
             
             // Normalizing to KD splits into (base, combining) so we can check for Latin
             // characters and then strip off any NonSpacingMarks following them
-            foreach (char c in val.Normalize (NormalizationForm.FormKD)) {
+            foreach (char orig_c in val.Trim ().Normalize (NormalizationForm.FormKD)) {
+                char c = orig_c;
+                if (ignored_special_cases.ContainsKey (c)) {
+                    c = ignored_special_cases[c];
+                }
+                
+                if (c == ' ' || c == '\t') {
+                    got_space = true;
+                    continue;
+                }
+                
                 category = Char.GetUnicodeCategory (c);
-
-                if (ignored_special_cases.ContainsKey (c)) {
-                    sb.Append (ignored_special_cases[c]);
-                } else if (category == UnicodeCategory.OtherPunctuation) {
+                if (category == UnicodeCategory.OtherPunctuation) {
                     // Skip punctuation
                 } else if (!(previous_was_latin && category == UnicodeCategory.NonSpacingMark)) {
+                    if (got_space) {
+                        sb.Append (" ");
+                        got_space = false;
+                    }
                     sb.Append (c);
                 }
 

=== modified file 'src/Libraries/Hyena/Hyena/Tests/StringUtilTests.cs'
--- src/Libraries/Hyena/Hyena/Tests/StringUtilTests.cs	2009-02-26 20:04:55 +0000
+++ src/Libraries/Hyena/Hyena/Tests/StringUtilTests.cs	2009-03-01 20:09:16 +0000
@@ -235,6 +235,19 @@
             AssertSearchKey ("?", "");
             AssertSearchKey ("/", "");
         }
+        
+        [Test] // http://bugzilla.gnome.org/show_bug.cgi?id=573484
+        public void TestCollapseSpaces ()
+        {
+            AssertSearchKey ("  a  \t  b  ", "a b");
+            AssertSearchKey ("100 % techno", "100 techno");
+            
+            // Character in the set of special overrides
+            AssertSearchKey ("a \u00f8", "a o");
+            
+            // Invalid combining character
+            AssertSearchKey ("a \u0301", "a");
+        }
     }
 
     [TestFixture]

