3

When I try to insert the ñ in textbuffer TextView the CMD displays the following error:

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

Source example (c++ and gtkmm):

Glib::RefPtr<Gtk::TextBuffer> refTextBuffer = textView->get_buffer();
refTextBuffer->set_text("\xA4");            //hex ASCII
refTextBuffer->insert_at_cursor("ñ");
Andrew White
  • 52,720
  • 19
  • 113
  • 137
rChavz
  • 235
  • 3
  • 16

1 Answers1

1

It's wanting a UTF-8 value and you've selected something in the upper ASCII range that doesn't map to UFT-8. Looking here and then here it appears you need to use the value of 0xC3 0xB1 to get the desired affect. A quick guess for the code that should work for you is...

refTextBuffer->set_text("\xC3\xB1"); //Hex version of UTF-8 Value
Andrew White
  • 52,720
  • 19
  • 113
  • 137