Index: gtksourceview/gtksourceundomanager.c
===================================================================
RCS file: /cvs/gnome/gtksourceview/gtksourceview/gtksourceundomanager.c,v
retrieving revision 1.4
diff -u -r1.4 gtksourceundomanager.c
--- gtksourceview/gtksourceundomanager.c	27 Sep 2003 22:54:08 -0000	1.4
+++ gtksourceview/gtksourceundomanager.c	6 May 2004 09:43:26 -0000
@@ -614,14 +614,12 @@
 	if (um->priv->running_not_undoable_actions > 0)
 		return;
 
-	g_return_if_fail (strlen (text) == (guint)length);
-	
 	undo_action.action_type = GTK_SOURCE_UNDO_ACTION_INSERT;
 
 	undo_action.action.insert.pos    = gtk_text_iter_get_offset (pos);
 	undo_action.action.insert.text   = (gchar*) text;
 	undo_action.action.insert.length = length;
-	undo_action.action.insert.chars  = g_utf8_strlen (text, length);
+	undo_action.action.insert.chars  = g_utf8_pointer_to_offset (text, text + length);
 
 	if ((undo_action.action.insert.chars > 1) || (g_utf8_get_char (text) == '\n'))
 
