projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c411d6
)
Tolerate the inability to convert character encodings
author
John Darrington
<john@darrington.wattle.id.au>
Sat, 11 Apr 2009 07:49:36 +0000
(15:49 +0800)
committer
John Darrington
<john@darrington.wattle.id.au>
Sat, 11 Apr 2009 07:49:36 +0000
(15:49 +0800)
src/libpspp/i18n.c
patch
|
blob
|
history
diff --git
a/src/libpspp/i18n.c
b/src/libpspp/i18n.c
index f10a52a50e271a4081bfff8252429d4b3edc856f..2be02f26cd58e34b883ff170d50220a88c989743 100644
(file)
--- 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;
}