From e76bf3e452d69b606067dbd1fbe8c64b0e2bf8a1 Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 31 Jan 2005 07:07:05 +0000 Subject: replace every non-UTF8 8bit character in the source window etc. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@58 ee746299-78ed-0310-b773-934348b2243d --- src/codeconv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/codeconv.c') diff --git a/src/codeconv.c b/src/codeconv.c index 47404702..32b3918f 100644 --- a/src/codeconv.c +++ b/src/codeconv.c @@ -788,7 +788,10 @@ static void conv_euctodisp(gchar *outbuf, gint outlen, const gchar *inbuf) void conv_utf8todisp(gchar *outbuf, gint outlen, const gchar *inbuf) { - strncpy2(outbuf, inbuf, outlen); + if (g_utf8_validate(inbuf, -1, NULL) == TRUE) + strncpy2(outbuf, inbuf, outlen); + else + conv_ustodisp(outbuf, outlen, inbuf); } static void conv_anytodisp(gchar *outbuf, gint outlen, const gchar *inbuf) -- cgit v1.2.3