GNOME Bugzilla – Bug 159373
gtk+ crashes when pasting illegal utf-8 into entry widget
Last modified: 2004-12-22 21:47:04 UTC
Cat a iso-8859-1 file in a utf-8 gnome-terminal, the non-ascii chars shows up as squares or blanks depending on the font. Select some of the text including non-ascii chars and paste into an entry widget. This will give the following warnings: (gtk-demo:10623): Gdk-WARNING **: Error converting selection from UTF8_STRING ** (gtk-demo:10623): WARNING **: Invalid UTF8 string passed to pango_layout_set_text() ** (gtk-demo:10623): CRITICAL **: file pango-layout.c: line 1771 (pango_layout_get_cursor_pos): assertion `index >= 0 && index <= layout->length' failed ** (gtk-demo:10623): CRITICAL **: file pango-layout.c: line 1771 (pango_layout_get_cursor_pos): assertion `index >= 0 && index <= layout->length' failed the last warning is repeated everytime the cursor flashes. Pressing the left or right arrow keys at this point will crash the application (Segmentation fault). Stack trace: (gdb) bt
+ Trace 52613
Created attachment 34109 [details] Non utf-8 to use for reproducing bug
2004-11-26 Matthias Clasen <mclasen@redhat.com> * gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display): Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg)