From fa00744e514a99087f5fe70cac9334b29a04c93a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 24 Sep 2002 04:19:03 +0000 Subject: Update. * iconv/iconv_prog.c (main): Provide an error message that identifies the wrong encoding. 2002-09-22 Bruno Haible * iconvdata/tscii.c: New file. * iconvdata/testdata/TSCII: New file. * iconvdata/testdata/TSCII..UTF8: New file. * iconvdata/TSCII.precomposed: New file. * iconvdata/TSCII.irreversible: New file. * iconvdata/gconv-modules (TSCII): New module. * iconvdata/Makefile (modules): Add TSCII. (distribute): Add tscii.c. * iconvdata/tst-table-from.c (try, utf8_decode, main): Double output buffer size. * iconvdata/tst-tables.sh: Add TSCII. * iconvdata/TESTS: Add TSCII. 2002-09-22 Bruno Haible Revert 2002-04-18 patch. * iconvdata/euc-jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for FROM_DIRECTION): Make the FROM direction stateful again. * iconvdata/shift_jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for FROM_DIRECTION): Likewise. 2002-09-22 Bruno Haible --- iconvdata/tst-table-from.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'iconvdata/tst-table-from.c') diff --git a/iconvdata/tst-table-from.c b/iconvdata/tst-table-from.c index 084de5f..34ea793 100644 --- a/iconvdata/tst-table-from.c +++ b/iconvdata/tst-table-from.c @@ -57,7 +57,7 @@ hexbuf (unsigned char buf[], unsigned int buflen) return msg; } -/* Attempts to convert a byte buffer BUF (BUFLEN bytes) to OUT (6 bytes) +/* Attempts to convert a byte buffer BUF (BUFLEN bytes) to OUT (12 bytes) using the conversion descriptor CD. Returns the number of written bytes, or 0 if ambiguous, or -1 if invalid. */ static int @@ -66,7 +66,7 @@ try (iconv_t cd, unsigned char buf[], unsigned int buflen, unsigned char *out) const char *inbuf = (const char *) buf; size_t inbytesleft = buflen; char *outbuf = (char *) out; - size_t outbytesleft = 6; + size_t outbytesleft = 12; size_t result; iconv (cd, NULL, NULL, NULL, NULL); @@ -100,10 +100,10 @@ try (iconv_t cd, unsigned char buf[], unsigned int buflen, unsigned char *out) fprintf (stderr, "%s: inbytes = %ld, outbytes = %ld\n", hexbuf (buf, buflen), (long) (buflen - inbytesleft), - (long) (6 - outbytesleft)); + (long) (12 - outbytesleft)); exit (1); } - return 6 - outbytesleft; + return 12 - outbytesleft; } } @@ -111,7 +111,7 @@ try (iconv_t cd, unsigned char buf[], unsigned int buflen, unsigned char *out) static const char * utf8_decode (const unsigned char *out, unsigned int outlen) { - static char hexbuf[42]; + static char hexbuf[84]; char *p = hexbuf; while (outlen > 0) @@ -203,7 +203,7 @@ main (int argc, char *argv[]) search_depth = (strcmp (charset, "UTF-8") == 0 ? 3 : 4); { - unsigned char out[6]; + unsigned char out[12]; unsigned char buf[4]; unsigned int i0, i1, i2, i3; int result; -- cgit v1.1