UTF-8 text format issue in gtk

945 Views Asked by At

Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion 'g_utf8_validate (text, len, NULL)' failed

The above error comes when I open the popup window containing GtkTextView but this not happen all the time sometimes no error shown and text appear as expected but when I recompile for other changes the error appear and no text appear in gtktextview but again if i recompile the error remove on its own. I don't understand such strange behavior , I have already tried converting text into UTF-8 format but same thing happens , no change.

Copied from comment:

char buff[1024];
version_buf = gtk_text_buffer_new(NULL);
messege = gtk_text_view_new_with_buffer(version_buf);
sprintf(buff,"Some long string data");
length = strlen(buff);
buff[length] = '\0';
gtk_text_buffer_set_text(version_buf,buff,length);
0

There are 0 best solutions below