2005-09-18 [colin] 1.9.14cvs39
[claws.git] / src / codeconv.c
index f02603d58a069482292ab0e5fe196b35423d604b..3e7676b11b0f82f822078b61b471729c888348ec 100644 (file)
@@ -672,9 +672,12 @@ void conv_localetodisp(gchar *outbuf, gint outlen, const gchar *inbuf)
 
        tmpstr = conv_iconv_strdup(inbuf, conv_get_locale_charset_str(),
                                   CS_INTERNAL);
-       if (tmpstr) {
+       if (tmpstr && g_utf8_validate(tmpstr, -1, NULL)) {
                strncpy2(outbuf, tmpstr, outlen);
                g_free(tmpstr);
+       } else if (tmpstr && !g_utf8_validate(tmpstr, -1, NULL)) {
+               g_free(tmpstr);
+               conv_utf8todisp(outbuf, outlen, inbuf);
        } else
                conv_utf8todisp(outbuf, outlen, inbuf);
 }