--- ./work/glib-2.14.2/glib/gunicollate.c.ORIG	2007-11-05 10:20:51.000000000 -0500
+++ ./work/glib-2.14.2/glib/gunicollate.c	2007-11-05 10:29:58.000000000 -0500
@@ -166,11 +166,33 @@
   str1_norm = g_utf8_normalize (str1, -1, G_NORMALIZE_ALL_COMPOSE);
   str2_norm = g_utf8_normalize (str2, -1, G_NORMALIZE_ALL_COMPOSE);
 
-  if (g_get_charset (&charset))
+/* It is possible that caller has given us one or both strings which are not really
+ *  valid UTF-8 and g_utf8_normalize returned NULL. Proposed logic in this case -- 
+ *  invalid (NULL) UTF-8 string is always less then the valid one, and two NULLs are
+ *  equal
+ */
+  if ((str1_norm == NULL) || (str2_norm == NULL))
+  {
+     if(str1_norm)
+     {
+       result = 1;
+       g_free(str1_norm);
+     }
+     else if(str2_norm)
+     {
+       result = -1;
+       g_free(str2_norm);
+     }
+     else
+       result = 0;
+  }
+  else
+  {
+    if (g_get_charset (&charset))
     {
       result = strcoll (str1_norm, str2_norm);
     }
-  else
+    else
     {
       gchar *str1_locale = g_convert (str1_norm, -1, charset, "UTF-8", NULL, NULL, NULL);
       gchar *str2_locale = g_convert (str2_norm, -1, charset, "UTF-8", NULL, NULL, NULL);
@@ -187,9 +209,9 @@
       g_free (str1_locale);
       g_free (str2_locale);
     }
-
-  g_free (str1_norm);
-  g_free (str2_norm);
+    g_free (str1_norm);
+    g_free (str2_norm);
+  }
 
 #endif /* __STDC_ISO_10646__ */
 
