David Nečas writes:> On Sun, Feb 25, 2007 at 03:58:57AM +0000, Kumar Appaiah wrote:> > I am trying to display a UTF-8 file in a very simple GTK+ application using a> > text view> > ...> > actualText = g_convert((const gchar *)buf, (gssize) n,> > "UTF-8",> > "ISO8859-1",> > &n_read,> > &n_written,> > NULL);> > If the file is already in UTF-8, why you convert it from ISO> Latin1 to UTF-8? And if it isn't in UTF-8, why you call it> `UTF-8 file'? This does not make sense. I have commented that line out now, but still no use. > > gtk_text_buffer_set_text(GTK_TEXT_BUFFER(textBuffer),> > actualText, n);> > n is not the length of the converted text in bytes (unless> it's pure ASCII), it's the length of the text *before*> conversion. So in addition to being possibly misconverted> the text is truncated too. In that case, I then set n to strlen(actualText), which should give me the rightvalue, as strlen checks for '\0'. But now, I get this: (llf_utf:21130): Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion`g_utf8_validate (text, len, NULL)' failed Thanks. Kumar _______________________________________________gtk-list mailing listgtk-list@xxxxxxxxxxxxx://mail.gnome.org/mailman/listinfo/gtk-list