if (from == NULL)
from = default_encoding;
+ conv = create_iconv (to, from);
+
+ if ( (iconv_t) -1 == conv )
+ return xstrdup (text);
+
for ( outbufferlength = 1 ; outbufferlength != 0; outbufferlength <<= 1 )
if ( outbufferlength > length)
break;
inbytes = length;
- conv = create_iconv (to, from);
-
- if ( (iconv_t) -1 == conv )
- return xstrdup (text);
-
do {
const char *ip = text;
result = iconv (conv, (ICONV_CONST char **) &text, &inbytes,