X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=blobdiff_plain;f=src%2Flibpspp%2Fi18n.c;h=3735e95d8438821e6b338641581836f83dc7da7c;hp=eb082c5d94b4f9bc0f798f8f0bf0c17e095d8a81;hb=b042e2bf98b0e320ee55213252bac1a0260fafc3;hpb=425d780e0e2cc08c58722145df4d3dd808f01d48 diff --git a/src/libpspp/i18n.c b/src/libpspp/i18n.c index eb082c5d94..3735e95d84 100644 --- a/src/libpspp/i18n.c +++ b/src/libpspp/i18n.c @@ -137,6 +137,11 @@ recode_string_pool (const char *to, const char *from, 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; @@ -148,11 +153,6 @@ recode_string_pool (const char *to, const char *from, 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,