This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
bug in BIG5 converter
- To: libc-alpha at sources dot redhat dot com
- Subject: bug in BIG5 converter
- From: Bruno Haible <haible at ilog dot fr>
- Date: Mon, 4 Sep 2000 14:53:25 +0200 (CEST)
- Cc: Tung-Han Hsieh <thhsieh at linux dot org dot tw>
The BIG5 iconv converter from Big5 to Unicode contains identity mappings
for 0x81..0xA0, 0xFA..0xFF. But the reverse direction doesn't do them, and
the charmap doesn't contain them either.
Here is a patch to remove this identity mapping.
2000-09-03 Bruno Haible <haible@clisp.cons.org>
* iconvdata/big5.c (BODY for FROM_LOOP): Bytes 0x81..0xA0, 0xFA..0xFF
are invalid.
*** glibc-20000831/iconvdata/big5.c.bak Wed Aug 30 23:43:37 2000
--- glibc-20000831/iconvdata/big5.c Sun Sep 3 15:34:12 2000
***************
*** 8644,8651 ****
\
inptr += 2; \
} \
! else \
++inptr; \
\
put32 (outptr, ch); \
outptr += 4; \
--- 8644,8664 ----
\
inptr += 2; \
} \
! else if (ch <= 0x80) \
++inptr; \
+ else \
+ { \
+ /* This is illegal. */ \
+ if (! ignore_errors_p ()) \
+ { \
+ result = __GCONV_ILLEGAL_INPUT; \
+ break; \
+ } \
+ \
+ ++inptr; \
+ ++*irreversible; \
+ continue; \
+ } \
\
put32 (outptr, ch); \
outptr += 4; \