GtkTextBuffer discard user's data
Steps to reproduce
- Insert
gtk_text_buffer_insert
text with some of invalid utf-8 codes
Current behavior
Stop work flow and did not display text
Expected outcome
- Show some text (without invalid utf-8 codes)
- Output a warning message is good.
Version information
GTK 4.10.1
Additional information
gtktextbuffer.c#L1220 break the work flow
static void
gtk_text_buffer_emit_insert (GtkTextBuffer *buffer,
GtkTextIter *iter,
const char *text,
int len)
{
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
g_return_if_fail (text != NULL);
if (len < 0)
len = strlen (text);
g_return_if_fail (g_utf8_validate (text, len, NULL));
if (len > 0)
{
g_signal_emit (buffer, signals[INSERT_TEXT], 0,
iter, text, len);
}
}
Edited by TAO ZUHONG