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 ANSI_X3.110-1983 converter



The iconv converter module for ANSI_X3.110-1983 has a bug: it converts
U+00ED to 0xC2E9 instead of 0xC269, and it converts 0x2022 instead of
0x2122 and 0x2026 instead of 0x2126.

*** ISO-IR-99.TXT       Sun Jul 30 16:33:35 2000
--- ISO-IR-99.INVERSE.TXT       Sun Jul 30 16:33:35 2000
***************
*** 215,217 ****
  0xC265        0x00E9
- 0xC269        0x00ED
  0xC26C        0x013A
--- 215,216 ----
***************
*** 224,225 ****
--- 223,225 ----
  0xC27A        0x017A
+ 0xC2E9        0x00ED
  0xC341        0x00C2
***************
*** 358,360 ****
  0xD3  0x00A9
! 0xD4  0x2122
  0xD5  0x266A
--- 358,360 ----
  0xD3  0x00A9
! 0xD4  0x2022
  0xD5  0x266A
***************
*** 370,372 ****
  0xDF  0x215E
! 0xE0  0x2126
  0xE1  0x00C6
--- 370,372 ----
  0xDF  0x215E
! 0xE0  0x2026
  0xE1  0x00C6

Here is a fix.

2000-07-30  Bruno Haible  <haible@clisp.cons.org>

	* iconvdata/ansi_x3.110.c (from_ucs4): Change entry for 0xed.
	(BODY for TO_LOOP): Map U+2122, U+2126, not U+2022, U+2026.

*** glibc-20000729/iconvdata/ansi_x3.110.c.bak	Mon Jul  3 16:39:26 2000
--- glibc-20000729/iconvdata/ansi_x3.110.c	Sun Jul 30 19:22:44 2000
***************
*** 319,325 ****
    /* 0x00dc */ "\xc8\x55", "\xc2\x59", "\xec\x00", "\xfb\x00", "\xc1\x61",
    /* 0x00e1 */ "\xc2\x61", "\xc3\x61", "\xc4\x61", "\xc8\x61", "\xca\x61",
    /* 0x00e6 */ "\xf1\x00", "\xcb\x63", "\xc1\x65", "\xc2\x65", "\xc3\x65",
!   /* 0x00eb */ "\xc8\x65", "\xc1\x69", "\xc2\xe9", "\xc3\x69", "\xc8\x69",
    /* 0x00f0 */ "\xf3\x00", "\xc4\x6e", "\xc1\x6f", "\xc2\x6f", "\xc3\x6f",
    /* 0x00f5 */ "\xc4\x6f", "\xc8\x6f", "\xb8\x00", "\xf9\x00", "\xc1\x75",
    /* 0x00fa */ "\xc2\x75", "\xc3\x75", "\xc8\x75", "\xc2\x79", "\xfc\x00",
--- 319,325 ----
    /* 0x00dc */ "\xc8\x55", "\xc2\x59", "\xec\x00", "\xfb\x00", "\xc1\x61",
    /* 0x00e1 */ "\xc2\x61", "\xc3\x61", "\xc4\x61", "\xc8\x61", "\xca\x61",
    /* 0x00e6 */ "\xf1\x00", "\xcb\x63", "\xc1\x65", "\xc2\x65", "\xc3\x65",
!   /* 0x00eb */ "\xc8\x65", "\xc1\x69", "\xc2\x69", "\xc3\x69", "\xc8\x69",
    /* 0x00f0 */ "\xf3\x00", "\xc4\x6e", "\xc1\x6f", "\xc2\x6f", "\xc3\x6f",
    /* 0x00f5 */ "\xc4\x6f", "\xc8\x6f", "\xb8\x00", "\xf9\x00", "\xc1\x75",
    /* 0x00fa */ "\xc2\x75", "\xc3\x75", "\xc8\x75", "\xc2\x79", "\xfc\x00",
***************
*** 487,499 ****
  	    tmp[1] = ' ';						      \
  	    cp = tmp;							      \
  	  }								      \
! 	else if (ch >= 0x2014 && ch <= 0x2026)				      \
  	  {								      \
! 	    static const char map[19] =					      \
! 	      "\xd0\x00\x00\x00\xa9\xb9\x00\x00\xaa\xba\x00\x00\x00\x00"      \
! 	      "\xd4\x00\x00\x00\xe0";					      \
  									      \
  	    tmp[0] = map[ch - 0x2014];					      \
  	    if (tmp[0] == '\0')						      \
  	      {								      \
  		/* Illegal characters.  */				      \
--- 487,512 ----
  	    tmp[1] = ' ';						      \
  	    cp = tmp;							      \
  	  }								      \
! 	else if (ch >= 0x2014 && ch <= 0x201d)				      \
  	  {								      \
! 	    static const char map[10] =					      \
! 	      "\xd0\x00\x00\x00\xa9\xb9\x00\x00\xaa\xba";		      \
  									      \
  	    tmp[0] = map[ch - 0x2014];					      \
+ 	    if (tmp[0] == '\0')						      \
+ 	      {								      \
+ 		/* Illegal characters.  */				      \
+ 		STANDARD_ERR_HANDLER (4);				      \
+ 	      }								      \
+ 	    tmp[1] = '\0';						      \
+ 	    cp = tmp;							      \
+ 	  }								      \
+ 	else if (ch >= 0x2122 && ch <= 0x2126)				      \
+ 	  {								      \
+ 	    static const char map[5] =					      \
+ 	      "\xd4\x00\x00\x00\xe0";					      \
+ 									      \
+ 	    tmp[0] = map[ch - 0x2122];					      \
  	    if (tmp[0] == '\0')						      \
  	      {								      \
  		/* Illegal characters.  */				      \

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