diff options
| author | Ulrich Drepper <drepper@redhat.com> | 1998-04-15 17:02:23 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 1998-04-15 17:02:23 +0000 |
| commit | f1fa8b68f3e7623a3ef86dcd0c7d090ccf0389f5 (patch) | |
| tree | 6779500e7e6e0d2dae115fc25d6b199efd1a76ee /iconvdata | |
| parent | 479e9b3f2135707d4bfd13bf6c2ad1a242ea6cfc (diff) | |
| download | glibc-f1fa8b68f3e7623a3ef86dcd0c7d090ccf0389f5.tar.xz glibc-f1fa8b68f3e7623a3ef86dcd0c7d090ccf0389f5.zip | |
Update.
1998-04-15 16:41 Ulrich Drepper <drepper@cygnus.com>
Don't name internal representation since it might be different from
the external form (namely on little endian machines).
* iconv/gconv_builtin.h: Add UCS4 support. Change references to
UCS4 into references to INTERNAL.
* iconv/gconv_simple.c: Implement UCS4<->INTERNAL converters.
Add endianess support to UCS functions. Change references to
UCS4 into references to INTERNAL.
* iconv/gconv_int.h: Change references to UCS4 into references to
INTERNAL.
* iconv/iconv_prog.c: Don't mention INTERNAL in --list output.
* iconvdata/gconv-modules: Change accordingly.
* wcsmbs/wcsmbsload.c: Change names to use INTERNAL.
* iconv/gconv_simple.c: Adjust input buffer pointer for output buffer
overflow.
* iconvdata/8bit-gap.c: Likewise.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/big5.c: Likewise.
* iconvdata/euccn.c: Likewise.
* iconvdata/eucjp.c: Likewise.
* iconvdata/euckr.c: Likewise.
* iconvdata/euctw.c: Likewise.
* iconvdata/iso646.c: Likewise.
* iconvdata/iso6937.c: Likewise.
* iconvdata/iso8859-1.c: Likewise.
* iconvdata/johab.c: Likewise.
* iconvdata/sjis.c: Likewise.
* iconvdata/t61.c: Likewise.
* iconvdata/uhc.c: Likewise.
* iconvdata/8bit-gap.c: Correct access to to_ucs4 array.
* iconvdata/8bit-generic.c: Likewise.
* iconvdata/TESTS: Add more tests.
* sysdeps/i386/bits/byteswap.h: Change to use "=r" when ror is used.
1998-04-15 11:47 Ulrich Drepper <drepper@cygnus.com>
* iconvdata/Makefile: Better rules to run tests.
* iconvdata/testdata/ISO-8859-1..UTF8: New file.
* iconvdata/testdata/ISO-8859-10: Likewise.
* iconvdata/testdata/ISO-8859-10..UCS2: Likewise.
* iconvdata/testdata/ISO-8859-2: Likewise.
* iconvdata/testdata/ISO-8859-2..UCS4: Likewise.
* iconvdata/testdata/ISO-8859-2..UTF8: Likewise.
* iconvdata/testdata/ISO-8859-3: Likewise.
* iconvdata/testdata/ISO-8859-4: Likewise.
* iconvdata/testdata/ISO-8859-5: Likewise.
* iconvdata/testdata/ISO-8859-6: Likewise.
* iconvdata/testdata/ISO-8859-7: Likewise.
* iconvdata/testdata/ISO-8859-8: Likewise.
* iconvdata/testdata/ISO-8859-9: Likewise.
* iconvdata/run-iconv-test.sh: Handle $from..$t file to compare
intermediate result (if available).
* iconvdata/Makefile: Add rules to run run-iconv-test.sh.
(distribute): Add run-iconv-test.sh and testdata/*.
* stdlib/testmb.c (main): Simplify mbc array handling.
* iconvdata/testdata/ISO-8859-1: New file.
Diffstat (limited to 'iconvdata')
31 files changed, 249 insertions, 70 deletions
diff --git a/iconvdata/8bit-gap.c b/iconvdata/8bit-gap.c index 6c78ce5c24..a8d3c99a68 100644 --- a/iconvdata/8bit-gap.c +++ b/iconvdata/8bit-gap.c @@ -110,7 +110,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, while (cnt < inchars && (outwchars + sizeof (wchar_t) <= data->outbufsize)) { - wchar_t ch = to_ucs4[(unsigned int) inbuf[cnt]]; + wchar_t ch = to_ucs4[((unsigned char *) inbuf)[cnt]]; if (ch == L'\0' && inbuf[cnt] != '\0') { @@ -125,6 +125,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, ++cnt; } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outwchars; } else @@ -158,6 +159,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, cnt += sizeof (wchar_t); } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outchars; if (outchars < data->outbufsize) diff --git a/iconvdata/8bit-generic.c b/iconvdata/8bit-generic.c index 52cd540fb7..19194ad068 100644 --- a/iconvdata/8bit-generic.c +++ b/iconvdata/8bit-generic.c @@ -97,7 +97,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, while (cnt < inchars && (outwchars + sizeof (wchar_t) <= data->outbufsize)) { - wchar_t ch = to_ucs4[(unsigned int) inbuf[cnt]]; + wchar_t ch = to_ucs4[((unsigned char *) inbuf)[cnt]]; if (ch == L'\0' && inbuf[cnt] != '\0') { @@ -112,6 +112,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, ++cnt; } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outwchars; } else @@ -136,6 +137,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, cnt += sizeof (wchar_t); } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outchars; if (outchars < data->outbufsize) diff --git a/iconvdata/Makefile b/iconvdata/Makefile index 48d44956f6..dd1c391c6c 100644 --- a/iconvdata/Makefile +++ b/iconvdata/Makefile @@ -94,7 +94,8 @@ distribute := 8bit-generic.c 8bit-gap.c gap.pl gaptab.pl gconv-modules \ ebcdic-at-de-a.c ebcdic-ca-fr.c jis0201.c jis0208.c jis0212.c \ extra-module.mk euckr.c johab.c uhc.c ksc5601.c ksc5601.h \ iso646.c big5.c eucjp.c gb2312.c gb2312.h euccn.c euctw.c \ - cns11643l1.c cns11643l1.h cns11643.h cns11643.c + cns11643l1.c cns11643l1.h cns11643.h cns11643.c \ + run-iconv-test.sh $(wildcard testdata/*) # We build the transformation modules only when we build shared libs. ifeq (yes,$(build-shared)) @@ -208,3 +209,14 @@ $(inst_gconvdir)/gconv-modules: gconv-modules $(+force) endif include ../Rules + +.PHONY: do-iconv-test +tests: do-iconv-test + +do-iconv-test: run-iconv-test.sh $(objpfx)gconv-modules \ + $(addprefix $(objpfx),$(modules.so)) \ + $(common-objdir)/iconv/iconv_prog + $(SHELL) -e $< $(common-objdir) > $(objpfx)iconv-test.out + +$(objpfx)gconv-modules: gconv-modules + cp $^ $@ diff --git a/iconvdata/TESTS b/iconvdata/TESTS index 809104d60f..41d7edcaf1 100644 --- a/iconvdata/TESTS +++ b/iconvdata/TESTS @@ -28,3 +28,12 @@ # N. target coded character set. ISO-8859-1 ISO-8859-1 UTF8 +ISO-8859-2 ISO-8859-2 UCS4 UTF8 +ISO-8859-3 ISO-8859-3 UTF8 +ISO-8859-4 ISO-8859-4 UTF8 +ISO-8859-5 ISO-8859-5 UTF8 +ISO-8859-6 ISO-8859-6 UTF8 +ISO-8859-7 ISO-8859-7 UTF8 +ISO-8859-8 ISO-8859-8 UTF8 +ISO-8859-9 ISO-8859-9 UTF8 +ISO-8859-10 ISO-8859-10 UCS2 UTF8 diff --git a/iconvdata/big5.c b/iconvdata/big5.c index bfd14fd5bb..a6a2580dd7 100644 --- a/iconvdata/big5.c +++ b/iconvdata/big5.c @@ -8540,6 +8540,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, ++cnt; } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outwchars; } else @@ -8632,6 +8633,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, cnt += sizeof (wchar_t); } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outchars; if (outchars + extra < data->outbufsize) diff --git a/iconvdata/euccn.c b/iconvdata/euccn.c index e8d909768b..f683836ff7 100644 --- a/iconvdata/euccn.c +++ b/iconvdata/euccn.c @@ -163,6 +163,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, ++cnt; } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outwchars; } else @@ -212,6 +213,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, cnt += sizeof (wchar_t); } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outchars; if (outchars + extra < data->outbufsize) diff --git a/iconvdata/eucjp.c b/iconvdata/eucjp.c index 4e82904c8f..e6a71cc791 100644 --- a/iconvdata/eucjp.c +++ b/iconvdata/eucjp.c @@ -180,6 +180,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, ++cnt; } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outwchars; } else @@ -256,6 +257,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, cnt += sizeof (wchar_t); } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outchars; if (outchars + extra < data->outbufsize) diff --git a/iconvdata/euckr.c b/iconvdata/euckr.c index 1dfa42dbcc..2ad9478729 100644 --- a/iconvdata/euckr.c +++ b/iconvdata/euckr.c @@ -182,6 +182,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, ++cnt; } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outwchars; } else @@ -226,6 +227,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, cnt += sizeof (wchar_t); } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outchars; if (outchars + extra < data->outbufsize) diff --git a/iconvdata/euctw.c b/iconvdata/euctw.c index f38db47946..fd422c1fb0 100644 --- a/iconvdata/euctw.c +++ b/iconvdata/euctw.c @@ -180,6 +180,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, ++cnt; } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outwchars; } else @@ -252,6 +253,7 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, cnt += sizeof (wchar_t); } *inbufsize -= cnt; + inbuf += cnt; data->outbufavail = outchars; if (outchars + extra < data->outbufsize) diff --git a/iconvdata/gconv-modules b/iconvdata/gconv-modules index ffdd8c321f..d5109dcf29 100644 --- a/iconvdata/gconv-modules +++ b/iconvdata/gconv-modules @@ -34,11 +34,6 @@ # name: the real name of the character set # from to module cost -alias ISO-10646// ISO-10646/UCS4/ -alias 10646-1:1993// ISO-10646/UCS4/ -alias 10646-1:1993/UCS4/ ISO-10646/UCS4/ - -# from to module cost alias ISO-IR-6// ANSI_X3.4-1968// alias ANSI_X3.4-1986// ANSI_X3.4-1968// alias ISO_646.IRV:1991// ANSI_X3.4-1968// @@ -48,15 +43,15 @@ alias US-ASCII// ANSI_X3.4-1968// alias US// ANSI_X3.4-1968// alias IBM367// ANSI_X3.4-1968// alias CP367// ANSI_X3.4-1968// -module ANSI_X3.4-1968// ISO-10646/UCS4/ ISO646 2 -module ISO-10646/UCS4/ ANSI_X3.4-1968// ISO646 2 +module ANSI_X3.4-1968// INTERNAL ISO646 2 +module INTERNAL ANSI_X3.4-1968// ISO646 2 alias ISO-IR-4// BS_4730// alias ISO646-GB// BS_4730// alias GB// BS_4730// alias UK// BS_4730// -module BS_4730// ISO-10646/UCS4/ ISO646 2 -module ISO-10646/UCS4/ BS_4730// ISO646 2 +module BS_4730// INTERNAL ISO646 2 +module INTERNAL BS_4730// ISO646 2 # from to module cost alias ISO-IR-100// ISO-8859-1// @@ -66,8 +61,8 @@ alias LATIN1// ISO-8859-1// alias L1// ISO-8859-1// alias IBM819// ISO-8859-1// alias CP819// ISO-8859-1// -module ISO-8859-1// ISO-10646/UCS4/ ISO8859-1 1 -module ISO-10646/UCS4/ ISO-8859-1// ISO8859-1 1 +module ISO-8859-1// INTERNAL ISO8859-1 1 +module INTERNAL ISO-8859-1// ISO8859-1 1 # from to module cost alias ISO-IR-101// ISO-8859-2// @@ -75,8 +70,8 @@ alias ISO_8859-2:1987// ISO-8859-2// alias ISO_8859-2// ISO-8859-2// alias LATIN2// ISO-8859-2// alias L2// ISO-8859-2// -module ISO-8859-2// ISO-10646/UCS4/ ISO8859-2 1 -module ISO-10646/UCS4/ ISO-8859-2// ISO8859-2 1 +module ISO-8859-2// INTERNAL ISO8859-2 1 +module INTERNAL ISO-8859-2// ISO8859-2 1 # from to module cost alias ISO-IR-109// ISO-8859-3// @@ -84,8 +79,8 @@ alias ISO_8859-3:1988// ISO-8859-3// alias ISO_8859-3// ISO-8859-3// alias LATIN3// ISO-8859-3// alias L3// ISO-8859-3// -module ISO-8859-3// ISO-10646/UCS4/ ISO8859-3 1 -module ISO-10646/UCS4/ ISO-8859-3// ISO8859-3 1 +module ISO-8859-3// INTERNAL ISO8859-3 1 +module INTERNAL ISO-8859-3// ISO8859-3 1 # from to module cost alias ISO-IR-110// ISO-8859-4// @@ -93,16 +88,16 @@ alias ISO_8859-4:1988// ISO-8859-4// alias ISO_8859-4// ISO-8859-4// alias LATIN4// ISO-8859-4// alias L4// ISO-8859-4// -module ISO-8859-4// ISO-10646/UCS4/ ISO8859-4 1 -module ISO-10646/UCS4/ ISO-8859-4// ISO8859-4 1 +module ISO-8859-4// INTERNAL ISO8859-4 1 +module INTERNAL ISO-8859-4// ISO8859-4 1 # from to module cost alias ISO-IR-144// ISO-8859-5// alias ISO_8859-5:1988// ISO-8859-5// alias ISO_8859-5// ISO-8859-5// alias CYRILLIC// ISO-8859-5// -module ISO-8859-5// ISO-10646/UCS4/ ISO8859-5 1 -module ISO-10646/UCS4/ ISO-8859-5// ISO8859-5 1 +module ISO-8859-5// INTERNAL ISO8859-5 1 +module INTERNAL ISO-8859-5// ISO8859-5 1 # from to module cost alias ISO-IR-127// ISO-8859-6// @@ -111,8 +106,8 @@ alias ISO_8859-6// ISO-8859-6// alias ECMA-114// ISO-8859-6// alias ASMO-708// ISO-8859-6// alias ARABIC// ISO-8859-6// -module ISO-8859-6// ISO-10646/UCS4/ ISO8859-6 1 -module ISO-10646/UCS4/ ISO-8859-6// ISO8859-6 1 +module ISO-8859-6// INTERNAL ISO8859-6 1 +module INTERNAL ISO-8859-6// ISO8859-6 1 # from to module cost alias ISO-IR-126// ISO-8859-7// @@ -122,16 +117,16 @@ alias ELOT_928// ISO-8859-7// alias ECMA-118// ISO-8859-7// alias GREEK// ISO-8859-7// alias GREEK8// ISO-8859-7// -module ISO-8859-7// ISO-10646/UCS4/ ISO8859-7 1 -module ISO-10646/UCS4/ ISO-8859-7// ISO8859-7 1 +module ISO-8859-7// INTERNAL ISO8859-7 1 +module INTERNAL ISO-8859-7// ISO8859-7 1 # from to module cost alias ISO-IR-138// ISO-8859-8// alias ISO_8859-8:1988// ISO-8859-8// alias ISO_8859-8// ISO-8859-8// alias HEBREW// ISO-8859-8// -module ISO-8859-8// ISO-10646/UCS4/ ISO8859-8 1 -module ISO-10646/UCS4/ ISO-8859-8// ISO8859-8 1 +module ISO-8859-8// INTERNAL ISO8859-8 1 +module INTERNAL ISO-8859-8// ISO8859-8 1 # from to module cost alias ISO-IR-148// ISO-8859-9// @@ -139,8 +134,8 @@ alias ISO_8859-9:1989// ISO-8859-9// alias ISO_8859-9// ISO-8859-9// alias LATIN5// ISO-8859-9// alias L5// ISO-8859-9// -module ISO-8859-9// ISO-10646/UCS4/ ISO8859-9 1 -module ISO-10646/UCS4/ ISO-8859-9// ISO8859-9 1 +module ISO-8859-9// INTERNAL ISO8859-9 1 +module INTERNAL ISO-8859-9// ISO8859-9 1 # from to module cost alias ISO-IR-157// ISO-8859-10// @@ -148,96 +143,96 @@ alias ISO_8859-10:1993// ISO-8859-10// alias ISO_8859-10// ISO-8859-10// alias LATIN6// ISO-8859-10// alias L6// ISO-8859-10// -module ISO-8859-10// ISO-10646/UCS4/ ISO8859-10 1 -module ISO-10646/UCS4/ ISO-8859-10// ISO8859-10 1 +module ISO-8859-10// INTERNAL ISO8859-10 1 +module INTERNAL ISO-8859-10// ISO8859-10 1 # from to module cost alias T.61// T.61-8BIT// alias ISO-IR-103// T.61-8BIT// -module T.61-8BIT// ISO-10646/UCS4/ T.61 1 -module ISO-10646/UCS4/ T.61-8BIT// T.61 1 +module T.61-8BIT// INTERNAL T.61 1 +module INTERNAL T.61-8BIT// T.61 1 # from to module cost alias ISO-IR-156// ISO_6937// alias ISO_6937:1992// ISO_6937// alias ISO6937// ISO_6937// -module ISO_6937// ISO-10646/UCS4/ ISO_6937 1 -module ISO-10646/UCS4/ ISO_6937// ISO_6937 1 +module ISO_6937// INTERNAL ISO_6937 1 +module INTERNAL ISO_6937// ISO_6937 1 # from to module cost alias SHIFT-JIS// SJIS// -module SJIS// ISO-10646/UCS4/ SJIS 1 -module ISO-10646/UCS4/ SJIS// SJIS 1 +module SJIS// INTERNAL SJIS 1 +module INTERNAL SJIS// SJIS 1 # from to module cost -module KOI-8// ISO-10646/UCS4/ KOI-8 1 -module ISO-10646/UCS4/ KOI-8// KOI-8 1 +module KOI-8// INTERNAL KOI-8 1 +module INTERNAL KOI-8// KOI-8 1 # from to module cost -module KOI8-R// ISO-10646/UCS4/ KOI8-R 1 -module ISO-10646/UCS4/ KOI8-R// KOI8-R 1 +module KOI8-R// INTERNAL KOI8-R 1 +module INTERNAL KOI8-R// KOI8-R 1 # from to module cost alias ISO-IR-19// LATIN-GREEK// -module LATIN-GREEK// ISO-10646/UCS4/ LATIN-GREEK 1 -module ISO-10646/UCS4/ LATIN-GREEK// LATIN-GREEK 1 +module LATIN-GREEK// INTERNAL LATIN-GREEK 1 +module INTERNAL LATIN-GREEK// LATIN-GREEK 1 # from to module cost alias ISO-IR-27// LATIN-GREEK// -module LATIN-GREEK-1// ISO-10646/UCS4/ LATIN-GREEK-1 1 -module ISO-10646/UCS4/ LATIN-GREEK-1// LATIN-GREEK-1 1 +module LATIN-GREEK-1// INTERNAL LATIN-GREEK-1 1 +module INTERNAL LATIN-GREEK-1// LATIN-GREEK-1 1 # from to module cost alias ROMAN8// HP-ROMAN8// alias R8// HP-ROMAN8// -module HP-ROMAN8// ISO-10646/UCS4/ HP-ROMAN8 1 -module ISO-10646/UCS4/ HP-ROMAN8// HP-ROMAN8 1 +module HP-ROMAN8// INTERNAL HP-ROMAN8 1 +module INTERNAL HP-ROMAN8// HP-ROMAN8 1 # from to module cost -module EBCDIC-AT-DE// ISO-10646/UCS4/ EBCDIC-AT-DE 1 -module ISO-10646/UCS4/ EBCDIC-AT-DE// EBCDIC-AT-DE 1 +module EBCDIC-AT-DE// INTERNAL EBCDIC-AT-DE 1 +module INTERNAL EBCDIC-AT-DE// EBCDIC-AT-DE 1 # from to module cost -module EBCDIC-AT-DE-A// ISO-10646/UCS4/ EBCDIC-AT-DE-A 1 -module ISO-10646/UCS4/ EBCDIC-AT-DE-A// EBCDIC-AT-DE-A 1 +module EBCDIC-AT-DE-A// INTERNAL EBCDIC-AT-DE-A 1 +module INTERNAL EBCDIC-AT-DE-A// EBCDIC-AT-DE-A 1 # from to m |
