From: John Darrington Date: Sat, 11 Apr 2009 07:49:36 +0000 (+0800) Subject: Tolerate the inability to convert character encodings X-Git-Tag: v0.7.3~164 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b273a2c9bdfaf0d37181a5ea78098a2f2125eb62;p=pspp-builds.git Tolerate the inability to convert character encodings --- diff --git a/src/libpspp/i18n.c b/src/libpspp/i18n.c index f10a52a5..2be02f26 100644 --- a/src/libpspp/i18n.c +++ b/src/libpspp/i18n.c @@ -128,6 +128,9 @@ recode_string (const char *to, const char *from, 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, @@ -161,6 +164,7 @@ recode_string (const char *to, const char *from, break; default: /* should never happen */ + fprintf (stderr, "Character conversion error: %s\n", strerror (the_error)); NOT_REACHED (); break; }