2006-10-16 [colin] 2.5.5cvs8
[claws.git] / src / textview.c
index d291c8cdca56b8fc7aff97b3e356d4e7612d6850..3a3ce795e7cdeae23018b5d00eb8601c871535f7 100644 (file)
@@ -1400,6 +1400,13 @@ static void textview_write_line(TextView *textview, const gchar *str,
        }
 
        if (real_quotelevel > -1 && do_quote_folding) {
+               if (!g_utf8_validate(buf, -1, NULL)) {
+                       gchar *utf8buf = NULL;
+                       utf8buf = g_malloc(BUFFSIZE);
+                       conv_localetodisp(utf8buf, BUFFSIZE, buf);
+                       strncpy2(buf, utf8buf, BUFFSIZE-1);
+                       g_free(utf8buf);
+               }
 do_quote:
                if ( previousquotelevel != real_quotelevel ) {
                        ClickableText *uri;