This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug in BIG5 converter



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;							      \

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]