aboutsummaryrefslogtreecommitdiff
path: root/iconvdata
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata')
-rw-r--r--iconvdata/8bit-gap.c7
-rw-r--r--iconvdata/8bit-generic.c4
-rw-r--r--iconvdata/ansi_x3.110.c4
-rw-r--r--iconvdata/big5.c3
-rw-r--r--iconvdata/big5hkscs.c4
-rw-r--r--iconvdata/cp1255.c5
-rw-r--r--iconvdata/cp1258.c5
-rw-r--r--iconvdata/euc-cn.c4
-rw-r--r--iconvdata/euc-jp.c4
-rw-r--r--iconvdata/euc-kr.c6
-rw-r--r--iconvdata/euc-tw.c16
-rw-r--r--iconvdata/gb18030.c35
-rw-r--r--iconvdata/gbk.c3
-rw-r--r--iconvdata/ibm930.c2
-rw-r--r--iconvdata/ibm932.c51
-rw-r--r--iconvdata/ibm933.c2
-rw-r--r--iconvdata/ibm935.c2
-rw-r--r--iconvdata/ibm937.c2
-rw-r--r--iconvdata/ibm939.c1
-rw-r--r--iconvdata/ibm943.c49
-rw-r--r--iconvdata/iso-2022-cn-ext.c1
-rw-r--r--iconvdata/iso-2022-cn.c4
-rw-r--r--iconvdata/iso-2022-jp.c697
-rw-r--r--iconvdata/iso-2022-kr.c7
-rw-r--r--iconvdata/iso646.c7
-rw-r--r--iconvdata/iso8859-1.c4
-rw-r--r--iconvdata/iso_6937-2.c3
-rw-r--r--iconvdata/iso_6937.c3
-rw-r--r--iconvdata/johab.c3
-rw-r--r--iconvdata/sjis.c9
-rw-r--r--iconvdata/t.61.c4
-rwxr-xr-xiconvdata/tst-table-charmap.sh4
-rw-r--r--iconvdata/tst-table-from.c40
-rw-r--r--iconvdata/tst-table-to.c31
-rwxr-xr-xiconvdata/tst-table.sh13
-rw-r--r--iconvdata/uhc.c3
-rw-r--r--iconvdata/unicode.c3
37 files changed, 657 insertions, 388 deletions
diff --git a/iconvdata/8bit-gap.c b/iconvdata/8bit-gap.c
index 7caa5427d5..e349270b8d 100644
--- a/iconvdata/8bit-gap.c
+++ b/iconvdata/8bit-gap.c
@@ -1,6 +1,6 @@
/* Generic conversion to and from 8bit charsets,
converting from UCS using gaps.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -83,7 +83,10 @@ struct gap
unsigned char res; \
\
if (__builtin_expect (ch, 0) >= 0xffff) \
- rp = NULL; \
+ { \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ rp = NULL; \
+ } \
else \
while (ch > rp->end) \
++rp; \
diff --git a/iconvdata/8bit-generic.c b/iconvdata/8bit-generic.c
index bc05ccd8db..3a81080c4c 100644
--- a/iconvdata/8bit-generic.c
+++ b/iconvdata/8bit-generic.c
@@ -1,5 +1,5 @@
/* Generic conversion to and from 8bit charsets.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -67,6 +67,8 @@
if (__builtin_expect (ch >= sizeof (from_ucs4) / sizeof (from_ucs4[0]), 0)\
|| (__builtin_expect (from_ucs4[ch], '\1') == '\0' && ch != 0)) \
{ \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
/* This is an illegal character. */ \
STANDARD_ERR_HANDLER (4); \
} \
diff --git a/iconvdata/ansi_x3.110.c b/iconvdata/ansi_x3.110.c
index e1dd0ed0a7..a06a4f0658 100644
--- a/iconvdata/ansi_x3.110.c
+++ b/iconvdata/ansi_x3.110.c
@@ -1,5 +1,5 @@
/* Generic conversion to and from ANSI_X3.110-1983.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -549,6 +549,8 @@ static const char from_ucs4[][2] =
cp = "\xd5"; \
else \
{ \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
/* Illegal characters. */ \
STANDARD_ERR_HANDLER (4); \
} \
diff --git a/iconvdata/big5.c b/iconvdata/big5.c
index e06b44609e..4d1f1acca4 100644
--- a/iconvdata/big5.c
+++ b/iconvdata/big5.c
@@ -1,5 +1,5 @@
/* Mapping tables for Big5 handling.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -8564,6 +8564,7 @@ static const char from_ucs4_tab15[][2] =
cp = from_ucs4_tab15[ch - 0xff01]; \
break; \
default: \
+ UNICODE_TAG_HANDLER (ch, 4); \
/* Illegal character. */ \
cp = ""; \
break; \
diff --git a/iconvdata/big5hkscs.c b/iconvdata/big5hkscs.c
index 7f4a8c3bf2..dff5456868 100644
--- a/iconvdata/big5hkscs.c
+++ b/iconvdata/big5hkscs.c
@@ -1,5 +1,5 @@
/* Mapping tables for Big5-HKSCS handling.
- Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Modified for Big5-HKSCS by Roger So <spacehunt@e-fever.org>, 2000.
@@ -11772,6 +11772,8 @@ static struct
\
if (cp[0] == '\0' && ch != 0) \
{ \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
/* Illegal character. */ \
STANDARD_ERR_HANDLER (4); \
} \
diff --git a/iconvdata/cp1255.c b/iconvdata/cp1255.c
index 127f8be406..d81e7da85c 100644
--- a/iconvdata/cp1255.c
+++ b/iconvdata/cp1255.c
@@ -451,7 +451,10 @@ static const struct {
else if (ch == 0x2122) \
res = 0x99; \
else \
- res = 0; \
+ { \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ res = 0; \
+ } \
\
if (__builtin_expect (res != 0, 1)) \
{ \
diff --git a/iconvdata/cp1258.c b/iconvdata/cp1258.c
index b4168d9781..4868e7559c 100644
--- a/iconvdata/cp1258.c
+++ b/iconvdata/cp1258.c
@@ -777,7 +777,10 @@ static const struct {
else if (ch == 0x2122) \
res = 0x99; \
else \
- res = 0; \
+ { \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ res = 0; \
+ } \
\
if (__builtin_expect (res != 0, 1)) \
{ \
diff --git a/iconvdata/euc-cn.c b/iconvdata/euc-cn.c
index 58f47eda3f..29ed465979 100644
--- a/iconvdata/euc-cn.c
+++ b/iconvdata/euc-cn.c
@@ -1,5 +1,5 @@
/* Mapping tables for EUC-CN handling.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -140,6 +140,8 @@
{ \
if (__builtin_expect (found, 0) == __UNKNOWN_10646_CHAR) \
{ \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
/* Illegal character. */ \
STANDARD_ERR_HANDLER (4); \
} \
diff --git a/iconvdata/euc-jp.c b/iconvdata/euc-jp.c
index 8d8429614d..e0512cf12e 100644
--- a/iconvdata/euc-jp.c
+++ b/iconvdata/euc-jp.c
@@ -1,5 +1,5 @@
/* Mapping tables for EUC-JP handling.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -227,6 +227,8 @@
} \
else \
{ \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
/* Illegal character. */ \
STANDARD_ERR_HANDLER (4); \
} \
diff --git a/iconvdata/euc-kr.c b/iconvdata/euc-kr.c
index 5ecdbb8182..7ec613b3f9 100644
--- a/iconvdata/euc-kr.c
+++ b/iconvdata/euc-kr.c
@@ -1,5 +1,5 @@
/* Mapping tables for EUC-KR handling.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jungshik Shin <jshin@pantheon.yale.edu>
and Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -142,10 +142,12 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
\
/* Decomposing Hangul syllables not available in KS C 5601 into \
Jamos should be considered either here or in euckr_from_ucs4() */ \
- euckr_from_ucs4 (ch, cp) ; \
+ euckr_from_ucs4 (ch, cp); \
\
if (__builtin_expect (cp[0], '\1') == '\0' && ch != 0) \
{ \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
/* Illegal character. */ \
STANDARD_ERR_HANDLER (4); \
} \
diff --git a/iconvdata/euc-tw.c b/iconvdata/euc-tw.c
index 39c2f1f7da..68a80f7c6d 100644
--- a/iconvdata/euc-tw.c
+++ b/iconvdata/euc-tw.c
@@ -1,5 +1,5 @@
/* Mapping tables for EUC-TW handling.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -61,14 +61,14 @@
} \
else \
{ \
- /* Two or more byte character. First test whether the next \
- character is also available. */ \
+ /* Two or more byte character. First test whether the next byte \
+ is also available. */ \
uint32_t ch2; \
\
if (inptr + 1 >= inend) \
{ \
- /* The second character is not available. Store the \
- intermediate result. */ \
+ /* The second byte is not available. Store the intermediate \
+ result. */ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
@@ -99,7 +99,7 @@
\
if (ch == 0) \
{ \
- /* The third or fourth character is not available. Store \
+ /* The third or fourth byte is not available. Store \
the intermediate result. */ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
@@ -170,7 +170,7 @@
*outptr++ = ch; \
else \
{ \
- /* Try the JIS character sets. */ \
+ /* Try the CNS 11643 planes. */ \
size_t found; \
\
found = ucs4_to_cns11643l1 (ch, outptr, outend - outptr); \
@@ -199,6 +199,8 @@
} \
if (__builtin_expect (found, 0) == __UNKNOWN_10646_CHAR) \
{ \
+ UNICODE_TAG_HANDLER (ch, 4); \
+ \
/* Illegal character. */ \
STANDARD_ERR_HANDLER (4); \
} \
diff --git a/iconvdata/gb18030.c b/iconvdata/gb18030.c
index 8b8c472074..e3e9e8a66d 100644
--- a/iconvdata/gb18030.c
+++ b/iconvdata/gb18030.c
@@ -5683,7 +5683,8 @@ static const uint16_t __fourbyte_to_ucs1[] =
[0x0309] = 0x03e5, [0x030a] = 0x03e6, [0x030b] = 0x03e7, [0x030c] = 0x03e8,
[0x030d] = 0x03e9, [0x030e] = 0x03ea, [0x030f] = 0x03eb, [0x0310] = 0x03ec,
[0x0311] = 0x03ed, [0x0312] = 0x03ee, [0x0313] = 0x03ef, [0x0314] = 0x03f0,
- [0x0315] = 0x03f1, [0x0316] = 0x03f2, [0x0317] = 0x03f3, [0x0324] = 0x0400,
+ [0x0315] = 0x03f1, [0x0316] = 0x03f2, [0x0317] = 0x03f3, [0x0318] = 0x03f4,
+ [0x0319] = 0x03f5, [0x0324] = 0x0400,
[0x0325] = 0x0402, [0x0326] = 0x0403, [0x0327] = 0x0404, [0x0328] = 0x0405,
[0x0329] = 0x0406, [0x032a] = 0x0407, [0x032b] = 0x0408, [0x032c] = 0x0409,
[0x032d] = 0x040a, [0x032e] = 0x040b, [0x032f] = 0x040c, [0x0330] = 0x040d,
@@ -9517,6 +9518,7 @@ static const unsigned char __ucs_to_gb18030_tab1[][2] =
[0x036b] = "\x23\x0f", [0x036c] = "\x23\x10", [0x036d] = "\x23\x11",
[0x036e] = "\x23\x12", [0x036f] = "\x23\x13", [0x0370] = "\x23\x14",
[0x0371] = "\x23\x15", [0x0372] = "\x23\x16", [0x0373] = "\x23\x17",
+ [0x0374] = "\x23\x18", [0x0375] = "\x23\x19",
[0x0380] = "\x23\x24", [0x0381] = "\xa7\xa7", [0x0382] = "\x23\x25",
[0x0383] = "\x23\x26", [0x0384] = "\x23\x27", [0x0385] = "\x23\x28",
[0x0386] = "\x23\x29", [0x0387] = "\x23\x2a", [0x0388] = "\x23\x2b",
@@ -21954,15 +21956,15 @@ static const unsigned char __ucs_to_gb18030_tab2[][2] =
} \
else \
{ \
- /* Two or four byte character. First test whether the \
- next character is also available. */ \
+ /* Two or four byte character. First test whether the next \
+ byte is also available. */ \
uint32_t ch2; \
unsigned long int idx; \
\
if (inptr + 1 >= inend) \
{ \
- /* The second character is not available. Store \
- the intermediate result. */ \
+ /* The second byte is not available. Store the \
+ intermediate result. */ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
@@ -21992,7 +21994,7 @@ static const unsigned char __ucs_to_gb18030_tab2[][2] =
\
if (inptr + 3 >= inend) \
{ \
- /* Not all characters are available. Store \
+ /* Not all bytes are available. Store \
the intermediate result. */ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
@@ -22035,17 +22037,19 @@ static const unsigned char __ucs_to_gb18030_tab2[][2] =
+ ch3 - 0x81) * 10 + ch4 - 0x30; \
\
if (idx <= 0x4A18) \
- ch = __fourbyte_to_ucs1[idx]; \
+ ch = __fourbyte_to_ucs1[idx]; \
else if (idx >= 0x4ABD && idx <= 0x4F49) \
- ch = idx + 0x5543; \
+ ch = idx + 0x5543; \
else if (idx >= 0x4F4D && idx <= 0x4F83) \
- ch = __fourbyte_to_ucs2[idx-0x4F4D]; \
+ ch = __fourbyte_to_ucs2[idx-0x4F4D]; \
else if (idx >= 0x56BD && idx <= 0x8260) \
- ch = idx + 0x5543; \
+ ch = idx + 0x5543; \
else if (idx >= 0x93A9 && idx <= 0x99F9) \
- ch = __fourbyte_to_ucs3[idx-0x93A9]; \
+ ch = __fourbyte_to_ucs3[idx-0x93A9]; \
+ else if (idx >= 0x2E248 && idx <= 0x12E247) \
+ ch = idx - 0x1E248; \
else \
- ch = 0; \
+ ch = 0; \
\
if (ch == 0 && *inptr != '\0') \
{ \
@@ -22148,6 +22152,11 @@ static const unsigned char __ucs_to_gb18030_tab2[][2] =
len = 4; \
} \
} \
+ else if (ch >= 0x10000 && ch <= 0x10FFFF) \
+ { \
+ idx = ch + 0x1E248; \
+ len = 4; \
+ } \
else \
len = 0; \
\
@@ -22175,7 +22184,7 @@ static const unsigned char __ucs_to_gb18030_tab2[][2] =
} \
else /* len == 4 */ \
{ \
- /* See whether there is enough room for the second byte we \
+ /* See whether there is enough room for all four bytes we \
write. */ \
if (__builtin_expect (outptr + 3 >= o