Skip to content

Commit 97660e4

Browse files
committed
More updates
1 parent 1bbc1aa commit 97660e4

File tree

13 files changed

+72
-17
lines changed

13 files changed

+72
-17
lines changed

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ NEWS - user visible changes -*- outline -*-
7474
to a file (see "Dependencies options" in the GnuCOBOL manual)
7575

7676
** New option --gentable to build EBCDIC/ASCII translation tables,
77-
for use with the --febcdic-table option
77+
for use with -febcdic-table
7878

7979
* More notable changes
8080

cobc/cobc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,6 +2751,12 @@ cobc_print_info (void)
27512751
cobc_var_print (_("native EBCDIC"), _("no"), 0);
27522752
#endif
27532753

2754+
#ifdef HAVE_ICONV
2755+
cobc_var_print (_("iconv support"), _("yes"), 0);
2756+
#else
2757+
cobc_var_print (_("iconv support"), _("no"), 0);
2758+
#endif
2759+
27542760
cobc_var_print (_("extended screen I/O"), _(WITH_CURSES), 0);
27552761

27562762
snprintf (buff, sizeof(buff), "%d", WITH_VARSEQ);

cobc/gentable.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ gentable (FILE *stream, const char *code_ebcdic, const char *code_ascii, char re
8787
--ascii_size;
8888
++nb_irreversible;
8989
} else {
90-
cb_error (_("an error occurred after converting %ld characters"),
91-
(ebcdic_ptr - ebcdic));
90+
cb_error (_("an error occurred after converting %ld characters (%d)"),
91+
(ebcdic_ptr - ebcdic), errno);
9292
iconv_close (ic);
9393
return -1;
9494
}
@@ -128,11 +128,11 @@ gentable (FILE *stream, const char *code_ebcdic, const char *code_ascii, char re
128128
}
129129
}
130130
cb_note (COB_WARNOPT_NONE, 0,
131-
_("%d non-reversible conversions were arbitrarily made reversible, you might want to review the generated table"),
131+
_("%d non-reversible conversions have been arbitrarily made reversible, you may want to check the generated table"),
132132
nb_irreversible);
133133
} else {
134134
cb_note (COB_WARNOPT_NONE, 0,
135-
_("%d non-reversible conversions were performed, you might want to review the generated table"),
135+
_("%d non-reversible conversions have been performed, you may want to check the generated table"),
136136
nb_irreversible);
137137
}
138138
}
@@ -144,7 +144,7 @@ gentable (FILE *stream, const char *code_ebcdic, const char *code_ascii, char re
144144

145145
fprintf (stream, "\n# %s to %s translation table\n\n", code_ascii, code_ebcdic);
146146
if ((nb_irreversible == 0) || (reversible != 0)) {
147-
fprintf (stream, "# This translation being symmetric, the table is built from the previous one.\n\n");
147+
fprintf (stream, "# As this translation is symmetrical, the table is built from the previous one.\n\n");
148148
} else {
149149
output_table (stream, ebcdic);
150150
fprintf (stream, "\n");

cobc/help.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ cobc_print_usage_common_options (void)
150150
puts (_(" -MD output dependencies in .d files while compiling"));
151151
puts (_(" -ext <extension> add file extension for resolving COPY"));
152152
puts (_(" -fcopybook-deps output copybook names as dependencies"));
153-
puts (_(" --gentable=<ebcdic-enc>,<ascii-enc>[+]\toutput to stdout an EBCDIC/ASCII translation table between the given encodings and exit (append + to make the translation reversible)"));
153+
puts (_(" --gentable=<ebcdic-enc>,<ascii-enc>[+]\toutput a translation table between the\n"
154+
" given encodings to stdout and exit"));
154155
putchar ('\n');
155156
}
156157

config/alternate.ttbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
3939

4040
# "alternate" ASCII to (?) EBCDIC conversion table
4141
#
42-
# This translation being symmetric, the table is built from the previous one.
42+
# As this translation is symmetrical, the table is built from the previous one.

config/default.ttbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ E6 7E 73 74 75 76 77 78 79 7A AD A8 D4 5B D6 D7
7676

7777
# "default" 8-bit ASCII to EBCDIC 1047 conversion table (likely MF)
7878
#
79-
# This translation being symmetric, the table is built from the previous one.
79+
# As this translation is symmetrical, the table is built from the previous one.

config/ebcdic500_ascii8bit.ttbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7
4848

4949
# 8-bit ASCII to EBCDIC 500 conversion table (GCOS7)
5050
#
51-
# This translation being symmetric, the table is built from the previous one.
51+
# As this translation is symmetrical, the table is built from the previous one.

config/ebcdic500_latin1.ttbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ A2 A3 A5 B7 A9 A7 B6 BC BD BE AC 7C AF A8 B4 D7
4141

4242
# Latin-1 to EBCDIC 500 translation table
4343
#
44-
# This translation being symmetric, the table is built from the previous one.
44+
# As this translation is symmetrical, the table is built from the previous one.

configure.ac

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,28 @@ if test "x$LTLIBINTL" != x; then
10581058
LIBCOB_LIBS="$LIBCOB_LIBS $LTLIBINTL"
10591059
fi
10601060

1061+
# Checks for internationalization stuff
1062+
AM_LANGINFO_CODESET
1063+
1064+
AC_ARG_WITH([iconv],
1065+
[AS_HELP_STRING([--with-iconv],
1066+
[(GnuCOBOL) Use iconv for character set conversion (default: check)])],
1067+
[],
1068+
[with_iconv=check])
1069+
1070+
if test "$with_iconv" = yes -o "$with_iconv" = check; then
1071+
AM_ICONV
1072+
if test "$with_iconv" = yes && test "$am_cv_func_iconv" != yes; then
1073+
AC_MSG_ERROR([iconv library requested but not found])
1074+
fi
1075+
if test "$am_cv_func_iconv" = yes -a "x$LIBICONV" != x; then
1076+
PROGRAMS_LIBS="$PROGRAMS_LIBS $LIBICONV"
1077+
LIBCOB_LIBS="$LIBCOB_LIBS $LIBICONV"
1078+
fi
1079+
with_iconv="$am_cv_func_iconv"
1080+
fi
1081+
1082+
10611083
dnl
10621084
dnl Configure options part II (needing compilation)
10631085
dnl
@@ -2608,6 +2630,12 @@ if test "x$lt_cv_dlopen_self" != xyes; then
26082630
AC_DEFINE([COB_NO_SELFOPEN], [1])
26092631
fi
26102632
2633+
if test "$with_iconv" = yes; then
2634+
COB_HAS_ICONV=yes
2635+
else
2636+
COB_HAS_ICONV=no
2637+
fi
2638+
26112639
if test "$with_cisam" = yes; then
26122640
COB_HAS_ISAM=cisam
26132641
elif test "$with_disam" = yes; then
@@ -2729,6 +2757,7 @@ AC_SUBST([COB_BIGENDIAN])
27292757
dnl unused: AC_SUBST([COB_FIX_LIB])
27302758
AC_SUBST([COB_FIX_LIBTOOL])
27312759
2760+
AC_SUBST([COB_HAS_ICONV])
27322761
AC_SUBST([COB_HAS_ISAM])
27332762
AC_SUBST([COB_HAS_CURSES])
27342763
AC_SUBST([COB_HAS_XML2])

doc/gnucobol.texi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ Do automatic initialization of the COBOL runtime system.
10531053

10541054
@item --gentable=@var{ebcdic-enc},@var{ascii-enc}[+]
10551055
Build an EBCDIC/ASCII translation table between @var{ebcdic-enc} and @var{ascii-enc}, and exit.
1056-
The translation might not be reversible: append + to arbitrarily make it reversible.
1056+
The translation might not be reversible: characters with no equivalent in the other encoding are mapped to the substitution character, thus leaving unused characters in both encodings. Append + to make the translation reversible, by arbitrarily mapping together these unused characters.
10571057

10581058
@end table
10591059

0 commit comments

Comments
 (0)