if ( (iconv_t) -1 == conv )
return xstrdup (text);
+ /* Put the converter into the initial shift state, in case there was any
+ state information left over from its last usage. */
+ iconv (conv, NULL, 0, NULL, 0);
+
for ( outbufferlength = 1 ; outbufferlength != 0; outbufferlength <<= 1 )
if ( outbufferlength > length)
break;
}
/* Fall through */
case E2BIG:
+ iconv (conv, NULL, 0, NULL, 0);
pool_free (pool, outbuf);
outbufferlength <<= 1;
outbuf = pool_malloc (pool, outbufferlength);