diff options
Diffstat (limited to 'src/codeconv.c')
-rw-r--r-- | src/codeconv.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) |