diff options
author | John Crispin <blogic@openwrt.org> | 2014-10-27 15:51:25 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-10-27 15:51:25 +0000 |
commit | 20db415b8f43f743af066601e9a28576522b59b4 (patch) | |
tree | 1f60fcf98b290025a78c73addbd4a9874ac20767 /package | |
parent | edeaa79757ac79c2ccdc0bf7ff566b22ffa608ac (diff) | |
download | upstream-20db415b8f43f743af066601e9a28576522b59b4.tar.gz upstream-20db415b8f43f743af066601e9a28576522b59b4.tar.bz2 upstream-20db415b8f43f743af066601e9a28576522b59b4.zip |
libiconv: do not replace untranslatable characters with * or ?
Instead throw an -EILSEQ error.
Signed-off-by: Tjalling Hattink <t.hattink@fugro.nl>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43089 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r-- | package/libs/libiconv/src/iconv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/package/libs/libiconv/src/iconv.c b/package/libs/libiconv/src/iconv.c index cb4e947758..d2e19e3c45 100644 --- a/package/libs/libiconv/src/iconv.c +++ b/package/libs/libiconv/src/iconv.c @@ -244,7 +244,7 @@ static inline int utf8dec_wchar(wchar_t *c, unsigned char *in, size_t inb) return -1; } -static inline char latin9_translit(wchar_t c) +static inline wchar_t latin9_translit(wchar_t c) { /* a number of trivial iso-8859-15 <> utf-8 transliterations */ switch (c) { @@ -256,7 +256,7 @@ static inline char latin9_translit(wchar_t c) case 0x0152: return 0xBC; /* OE */ case 0x0153: return 0xBD; /* oe */ case 0x0178: return 0xBE; /* Y diaeresis */ - default: return '?'; + default: return 0xFFFD; /* cannot translate */ } } @@ -394,9 +394,9 @@ charok: c = latin9_translit(c); /* fall through */ case LATIN_1: + if (c > 0xff) goto ilseq; if (!*outb) goto toobig; - if (c < 0x100) **out = c; - else x++, **out = '*'; //FIXME: translit? + **out = c; ++*out; --*outb; break; |