Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update.
	* iconv/iconv_prog.c (main): Provide an error message that identifies
	the wrong encoding.

2002-09-22  Bruno Haible  <bruno@clisp.org>

	* 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  <bruno@clisp.org>

	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  <bruno@clisp.org>
  • Loading branch information
Ulrich Drepper committed Sep 24, 2002
1 parent f2a4443 commit fa00744
Show file tree
Hide file tree
Showing 16 changed files with 1,649 additions and 171 deletions.
28 changes: 28 additions & 0 deletions ChangeLog
@@ -1,3 +1,31 @@
2002-09-22 Bruno Haible <bruno@clisp.org>

* iconv/iconv_prog.c (main): Provide an error message that identifies
the wrong encoding.

2002-09-22 Bruno Haible <bruno@clisp.org>

* 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 <bruno@clisp.org>

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 <bruno@clisp.org>

* iconvdata/tst-e2big.c: New file.
Expand Down
46 changes: 42 additions & 4 deletions iconv/iconv_prog.c
Expand Up @@ -28,6 +28,7 @@
#include <langinfo.h>
#include <locale.h>
#include <search.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -216,10 +217,47 @@ main (int argc, char *argv[])
if (cd == (iconv_t) -1)
{
if (errno == EINVAL)
error (EXIT_FAILURE, 0,
_("conversion from `%s' to `%s' not supported"),
from_code[0] ? from_code : nl_langinfo (CODESET),
orig_to_code[0] ? orig_to_code : nl_langinfo (CODESET));
{
/* Try to be nice with the user and tell her which of the
two encoding names is wrong. This is possible because
all supported encodings can be converted from/to Unicode,
in other words, because the graph of encodings is
connected. */
bool from_wrong =
(iconv_open ("UTF-8", from_code) == (iconv_t) -1
&& errno == EINVAL);
bool to_wrong =
(iconv_open (to_code, "UTF-8") == (iconv_t) -1
&& errno == EINVAL);
const char *from_pretty =
(from_code[0] ? from_code : nl_langinfo (CODESET));
const char *to_pretty =
(orig_to_code[0] ? orig_to_code : nl_langinfo (CODESET));

if (from_wrong)
{
if (to_wrong)
error (EXIT_FAILURE, 0,
_("\
conversions from `%s' and to `%s' are not supported"),
from_pretty, to_pretty);
else
error (EXIT_FAILURE, 0,
_("conversion from `%s' is not supported"),
from_pretty);
}
else
{
if (to_wrong)
error (EXIT_FAILURE, 0,
_("conversion to `%s' is not supported"),
to_pretty);
else
error (EXIT_FAILURE, 0,
_("conversion from `%s' to `%s' is not supported"),
from_pretty, to_pretty);
}
}
else
error (EXIT_FAILURE, errno,
_("failed to start conversion processing"));
Expand Down
4 changes: 2 additions & 2 deletions iconvdata/Makefile
Expand Up @@ -51,7 +51,7 @@ modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \
GB18030 ISO-2022-CN-EXT VISCII GBBIG5 CP10007 KOI8-T \
GEORGIAN-PS GEORGIAN-ACADEMY ISO-IR-209 MAC-SAMI ARMSCII-8 \
TCVN5712-1 libJISX0213 EUC-JISX0213 SHIFT_JISX0213 \
ISO-2022-JP-3
ISO-2022-JP-3 TSCII

modules.so := $(addsuffix .so, $(modules))

Expand Down Expand Up @@ -166,7 +166,7 @@ distribute := gconv-modules extra-module.mk gap.awk gaptab.awk \
mac-sami.c ibm1160.c ibm1160.h ibm1161.c ibm1161.h \
ibm1163.c ibm1163.h ibm1164.c ibm1164.h jisx0213.c jisx0213.h \
euc-jisx0213.c shift_jisx0213.c iso-2022-jp-3.c \
tcvn5712-1.c armscii-8.c
tcvn5712-1.c armscii-8.c tscii.c

# We build the transformation modules only when we build shared libs.
ifeq (yes,$(build-shared))
Expand Down
1 change: 1 addition & 0 deletions iconvdata/TESTS
Expand Up @@ -118,3 +118,4 @@ TCVN-5712 TCVN-5712 Y UTF8
EUC-JISX0213 EUC-JISX0213 Y UTF8
SHIFT_JISX0213 SHIFT_JISX0213 Y UTF8
ISO-2022-JP-3 ISO-2022-JP-3 N UTF8
TSCII TSCII Y UTF8
1 change: 1 addition & 0 deletions iconvdata/TSCII.irreversible
@@ -0,0 +1 @@
0xAD 0x0B87
66 changes: 66 additions & 0 deletions iconvdata/TSCII.precomposed
@@ -0,0 +1,66 @@
0x82 0x0BB8 0x0BCD 0x0BB0 0x0BC0
0x87 0x0B95 0x0BCD 0x0BB7
0x88 0x0B9C 0x0BCD
0x89 0x0BB7 0x0BCD
0x8A 0x0BB8 0x0BCD
0x8B 0x0BB9 0x0BCD
0x8C 0x0B95 0x0BCD 0x0BB7 0x0BCD
0x99 0x0B99 0x0BC1
0x9A 0x0B9E 0x0BC1
0x9B 0x0B99 0x0BC2
0x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