Index: gtksourceiter.c
===================================================================
--- gtksourceiter.c	(revision 1255)
+++ gtksourceiter.c	(working copy)
@@ -32,6 +32,10 @@
 
 #define GTK_TEXT_UNKNOWN_CHAR 0xFFFC
 
+#define g_utf8_strcasestr	gtk_source_strcasestr
+#define g_utf8_strrcasestr	gtk_source_strrcasestr
+#define g_utf8_caselessnmatch	gtk_source_caselessnmatch
+
 /* this function acts like g_utf8_offset_to_pointer() except that if it finds a
  * decomposable character it consumes the decomposition length from the given
  * offset.  So it's useful when the offset was calculated for the normalized
@@ -56,6 +60,25 @@ pointer_from_offset_skipping_decomp (con
 	return p;
 }
 
+inline static gboolean
+cmp_prefix (const gchar *string,
+	    const gchar *prefix,
+	    guint	 prefix_len)
+{
+	GUnicodeType type;
+
+	if (strncmp (string, prefix, prefix_len) != 0)
+		return FALSE;
+	if (string[prefix_len] == '\0')
+		return TRUE;
+
+	type = g_unichar_type (g_utf8_get_char (string + prefix_len));
+
+	return type != G_UNICODE_NON_SPACING_MARK &&
+		type != G_UNICODE_ENCLOSING_MARK &&
+		type != G_UNICODE_NON_SPACING_MARK;
+}
+
 static const gchar *
 g_utf8_strcasestr (const gchar *haystack, const gchar *needle)
 {
@@ -95,7 +118,7 @@ g_utf8_strcasestr (const gchar *haystack
 
 	while (*p)
 	{
-		if ((strncmp (p, needle, needle_len) == 0))
+		if (cmp_prefix (p, needle, needle_len))
 		{
 			ret = pointer_from_offset_skipping_decomp (haystack, i);
 			goto finally_1;
@@ -150,7 +173,7 @@ g_utf8_strrcasestr (const gchar *haystac
 
 	while (p >= caseless_haystack)
 	{
-		if (strncmp (p, needle, needle_len) == 0)
+		if (cmp_prefix (p, needle, needle_len))
 		{
 			ret = pointer_from_offset_skipping_decomp (haystack, i);
 			goto finally_1;
