ISO_6937-2 (ISO-IR-90) converter fixes
Bruno Haible
bruno@clisp.org
Sun Jan 18 15:12:00 GMT 2004
Hi,
The comparison between the two directions of the ISO_6937-2 iconv converter
leads to the following table of irreversible mappings:
======================================================================
0x0020 0x02DC
0x0020 0x02DD
0x23 0x0023
0x24 0x00A4
0x7E 0x203E
0x7E 0x007E
0xA6 0x0023
0xA8 0x00A4
0xC269 0x00ED
0xC2E9 0x00ED
0xC420 0x007E
0xC520 0x00AF
0xCD20 0x02DD
0xD6 0x2500
0xD7 0x2502
0xD8 0x2571
0xD9 0x2572
0xDA 0x25E2
0xDB 0x25E3
0xE5 0x253C
======================================================================
Some of these are clearly typos and bugs, and the mappings of 0xD6..0xDB, 0xE5
are a leftover of the ansi_x3.110.c converter from which the iso_6937-2.c was
derived.
Here is a patch which reduces this to the following:
======================================================================
0x23 0x0023
0x24 0x00A4
0xC420 0x007E
======================================================================
2003-12-31 Bruno Haible <bruno@clisp.org>
* iconvdata/iso_6937-2.c (to_ucs4): Map 0x7E to U+007E, not U+203E.
Map 0xA6 to U+0023. Map 0xA8 to U+00A4.
(to_ucs4_comb): Map 0xC5 0x20 to U+00AF.
(from_ucs4): Map U+00ED to 0xC2 0x69, not 0xC2 0xE9.
(BODY for TO_LOOP): Don't map U+02DC. Map U+02DD to 0xCD 0x20, not
0x00 0x20. Don't map U+2500..U+25E3.
--- glibc-20031205/iconvdata/iso_6937-2.c.bak 2002-12-05 17:34:59.000000000 +0100
+++ glibc-20031205/iconvdata/iso_6937-2.c 2004-01-13 00:16:10.000000000 +0100
@@ -1,5 +1,5 @@
/* Generic conversion to and from ISO 6937-2.
- Copyright (C) 1998, 1999, 2000-2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000-2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -39,13 +39,13 @@
/* 0x60 */ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
/* 0x68 */ 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
/* 0x70 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- /* 0x78 */ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x203e, 0x007f,
+ /* 0x78 */ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
/* 0x80 */ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
/* 0x88 */ 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
/* 0x90 */ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
/* 0x98 */ 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
- /* 0xa0 */ 0x0000, 0x00a1, 0x00a2, 0x00a3, 0x0024, 0x00a5, 0x0000, 0x00a7,
- /* 0xa8 */ 0x0000, 0x2018, 0x201c, 0x00ab, 0x2190, 0x2191, 0x2192, 0x2193,
+ /* 0xa0 */ 0x0000, 0x00a1, 0x00a2, 0x00a3, 0x0024, 0x00a5, 0x0023, 0x00a7,
+ /* 0xa8 */ 0x00a4, 0x2018, 0x201c, 0x00ab, 0x2190, 0x2191, 0x2192, 0x2193,
/* 0xb0 */ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00d7, 0x00b5, 0x00b6, 0x00b7,
/* 0xb8 */ 0x00f7, 0x2019, 0x201d, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
/* 0xc0 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -124,7 +124,7 @@
},
/* 0xc5 */
{
- /* 0x20 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ /* 0x20 */ 0x00af, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
/* 0x28 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
/* 0x30 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
/* 0x38 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -317,7 +317,7 @@
/* 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",
+ /* 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",
@@ -364,14 +364,6 @@
...
0x2190 "\xac\x00", "\xad\x00", "\xae\x00", "\xaf\x00",
...
- 0x2500 "\xd6\x00", "\x00\x00", "\xd7\x00",
- ...
- 0x253c "\xe5\x00",
- ...
- 0x2571 "\xd8\x00", "\xd9\x00",
- ...
- 0x25e2 "\xda\x00", "\xdb\x00",
- ...
0x266a "\xd5\x00"
These would blow up the table and are therefore handled specially in
@@ -478,9 +470,10 @@
case 0x2c7: \
cp = "\xcf\x20"; \
break; \
- case 0x2d8 ... 0x2dd: \
+ case 0x2d8 ... 0x2db: \
+ case 0x2dd: \
{ \
- static const char map[6] = "\xc6\xc7\xca\xce\x00"; \
+ static const char map[6] = "\xc6\xc7\xca\xce\x00\xcd"; \
\
tmp[0] = map[ch - 0x2d8]; \
tmp[1] = ' '; \
@@ -518,27 +511,6 @@
tmp[1] = '\0'; \
cp = tmp; \
break; \
- case 0x2500: \
- cp = "\xd6"; \
- break; \
- case 0x2502: \
- cp = "\xd7"; \
- break; \
- case 0x253c: \
- cp = "\xe5"; \
- break; \
- case 0x2571: \
- cp = "\xd8"; \
- break; \
- case 0x2572: \
- cp = "\xd9"; \
- break; \
- case 0x25e2: \
- cp = "\xda"; \
- break; \
- case 0x25e3: \
- cp = "\xdb"; \
- break; \
case 0x266a: \
cp = "\xd5"; \
break; \
More information about the Libc-alpha
mailing list