Index: gtk/gtktextbtree.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextbtree.c,v
retrieving revision 1.76.2.2
diff -u -p -r1.76.2.2 gtktextbtree.c
--- gtk/gtktextbtree.c	26 Oct 2005 20:47:39 -0000	1.76.2.2
+++ gtk/gtktextbtree.c	1 Nov 2005 09:16:52 -0000
@@ -4157,16 +4157,11 @@ _gtk_text_line_char_to_byte_offsets (Gtk
 
   if (seg->type == &gtk_text_char_type)
     {
-      *seg_byte_offset = 0;
-      while (offset > 0)
-        {
-          gint bytes;
-          const char * start = seg->body.chars + *seg_byte_offset;
+      const char *p;
 
-          bytes = g_utf8_next_char (start) - start;
-          *seg_byte_offset += bytes;
-          offset -= 1;
-        }
+      p = g_utf8_offset_to_pointer (seg->body.chars, offset);
+
+      *seg_byte_offset = p - seg->body.chars;
 
       g_assert (*seg_byte_offset < seg->byte_count);
 
Index: gtk/gtktextiter.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextiter.c,v
retrieving revision 1.85
diff -u -p -r1.85 gtktextiter.c
--- gtk/gtktextiter.c	13 Jun 2005 05:15:10 -0000	1.85
+++ gtk/gtktextiter.c	1 Nov 2005 09:17:14 -0000
@@ -2394,19 +2394,14 @@ gtk_text_iter_backward_chars (GtkTextIte
 
       if (real->line_byte_offset >= 0)
         {
+          const char *p;
           gint new_byte_offset;
           gint i;
 
-          new_byte_offset = 0;
-          i = 0;
-          while (i < real->segment_char_offset)
-            {
-              const char * start = real->segment->body.chars + new_byte_offset;
-              new_byte_offset += g_utf8_next_char (start) - start;
-
-              ++i;
-            }
+          p = g_utf8_offset_to_pointer (real->segment->body.chars,
+                                        real->segment_char_offset);
 
+          new_byte_offset = p - real->segment->body.chars;
           real->line_byte_offset -= (real->segment_byte_offset - new_byte_offset);
           real->segment_byte_offset = new_byte_offset;
         }
