diff options
-rw-r--r-- | utils/utf8.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/utf8.c b/utils/utf8.c index a68d3c807..5425505ef 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -320,6 +320,10 @@ utf8_convert_ret utf8_convert(const char *string, size_t len, /* perform conversion */ if (iconv(cd, &in, &slen, &out, &rlen) == (size_t)-1) { free(temp); + /* clear the cached conversion descriptor as it's invalid */ + last_cd.from[0] = '\0'; + last_cd.to[0] = '\0'; + last_cd.cd = 0; /** \todo handle the various cases properly * There are 3 possible error cases: * a) Insufficiently large output buffer |