Index: gtksourceview/gtksourceiter.c
===================================================================
--- gtksourceview/gtksourceiter.c	(revision 1262)
+++ gtksourceview/gtksourceiter.c	(working copy)
@@ -56,8 +56,27 @@ pointer_from_offset_skipping_decomp (con
 	return p;
 }
 
+static gboolean
+exact_prefix_cmp (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)
+gtk_source_strcasestr (const gchar *haystack, const gchar *needle)
 {
 	gsize needle_len;
 	gsize haystack_len;
@@ -95,7 +114,7 @@ g_utf8_strcasestr (const gchar *haystack
 
 	while (*p)
 	{
-		if ((strncmp (p, needle, needle_len) == 0))
+		if (exact_prefix_cmp (p, needle, needle_len))
 		{
 			ret = pointer_from_offset_skipping_decomp (haystack, i);
 			goto finally_1;
@@ -112,7 +131,7 @@ finally_1:
 }
 
 static const gchar *
-g_utf8_strrcasestr (const gchar *haystack, const gchar *needle)
+gtk_source_strrcasestr (const gchar *haystack, const gchar *needle)
 {
 	gsize needle_len;
 	gsize haystack_len;
@@ -150,7 +169,7 @@ g_utf8_strrcasestr (const gchar *haystac
 
 	while (p >= caseless_haystack)
 	{
-		if (strncmp (p, needle, needle_len) == 0)
+		if (exact_prefix_cmp (p, needle, needle_len))
 		{
 			ret = pointer_from_offset_skipping_decomp (haystack, i);
 			goto finally_1;
@@ -167,8 +186,8 @@ finally_1:
 }
 
 static gboolean
-g_utf8_caselessnmatch (const char *s1, const char *s2,
-		       gssize n1, gssize n2)
+gtk_source_caselessnmatch (const char *s1, const char *s2,
+			   gssize n1, gssize n2)
 {
 	gchar *casefold;
 	gchar *normalized_s1;
@@ -200,7 +219,7 @@ g_utf8_caselessnmatch (const char *s1, c
 
 finally_2:
 	g_free (normalized_s1);
-	g_free (normalized_s2);	
+	g_free (normalized_s2); 
 
 	return ret;
 }
@@ -304,15 +323,15 @@ lines_match (const GtkTextIter *start,
 
 	if (match_start) /* if this is the first line we're matching */
 	{
-		found = g_utf8_strcasestr (line_text, *lines);
+		found = gtk_source_strcasestr (line_text, *lines);
 	}
 	else
 	{
 		/* If it's not the first line, we have to match from the
 		 * start of the line.
 		 */
-		if (g_utf8_caselessnmatch (line_text, *lines, strlen (line_text),
-					   strlen (*lines)))
+		if (gtk_source_caselessnmatch (line_text, *lines, strlen (line_text),
+					       strlen (*lines)))
 			found = line_text;
 		else
 			found = NULL;
@@ -402,15 +421,15 @@ backward_lines_match (const GtkTextIter 
 
 	if (match_start) /* if this is the first line we're matching */
 	{
-		found = g_utf8_strrcasestr (line_text, *lines);
+		found = gtk_source_strrcasestr (line_text, *lines);
 	}
 	else
 	{
 		/* If it's not the first line, we have to match from the
 		 * start of the line.
 		 */
-		if (g_utf8_caselessnmatch (line_text, *lines, strlen (line_text),
-					   strlen (*lines)))
+		if (gtk_source_caselessnmatch (line_text, *lines, strlen (line_text),
+					       strlen (*lines)))
 			found = line_text;
 		else
 			found = NULL;
