Skip to content

Commit 00e960f

Browse files
committed
Upgrade to libiconv-1.0.
1 parent 3af9cd3 commit 00e960f

File tree

129 files changed

+155959
-973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+155959
-973
lines changed

ChangeLog

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
2000-01-04 Bruno Haible <haible@clisp.cons.org>
2+
3+
* Version 1.0 released.
4+
* include/libiconv.h.in (_LIBICONV_VERSION): Bump version number.
5+
* src/Makefile.in (LIBICONV_VERSION_INFO): Define to 0:1:0.
6+
(libiconv.la): Use LIBICONV_VERSION_INFO.
7+
8+
2000-01-03 Bruno Haible <haible@clisp.cons.org>
9+
10+
* tests/Makefile.in: New file.
11+
tests/check-stateless, tests/table-from.c, tests/table-to.c,
12+
tests/*.TXT, tests/genutf8.c: New files, checks for stateless
13+
encodings.
14+
tests/check-stateful, tests/iconv.c, tests/*-snippet*: New files,
15+
checks for stateful encodings.
16+
* Makefile.in (all, check, mostlyclean, clean, distclean,
17+
maintainer-clean): Descend into tests directory.
18+
* configure.in: Add tests/Makefile to AC_OUTPUT duties.
19+
20+
* src/gentranslit.c: New file.
21+
* Makefile.devel (src/translit.h): New rule.
22+
* src/translit.def, src/translit.h: New files.
23+
* src/iconv.c: Include it.
24+
(iconv): Transliterate using translit.h table.
25+
26+
* src/genflags.c: New file.
27+
* Makefile.devel (src/flags.h): New rule.
28+
* src/flags.h: New file.
29+
* src/iconv.c: Include it.
30+
(encoding): Add field 'oflags'.
31+
(all_encodings): Initialize the field 'oflags'.
32+
(iconv_open): Copy field 'oflags'.
33+
(iconv): Transliterate quotation marks U+2018, U+2019, U+201A.
34+
* src/Makefile.in (iconv.lo): Update dependencies.
35+
36+
* src/converters.h: New file, extracted from src/iconv.c.
37+
* src/iconv.c: Include it.
38+
* src/Makefile.in (iconv.lo): Update dependencies.
39+
40+
* tools/cjk_variants.c: New file.
41+
* tools/Makefile (ALL): Add cjk_variants.h.
42+
(cjk_variants.h, cjk_variants): New rules.
43+
* src/cjk_variants.h: New file.
44+
* src/iconv.c: Include it.
45+
(iconv): Use cjk_variants for transliteration.
46+
47+
* man/iconv.3: Fix description of return value.
48+
* euc_kr.h (euc_kr_wctomb): Remove Hangul transliteration.
49+
* iso2022_kr.h (iso2022kr_wctomb): Likewise.
50+
* src/iconv.c (iconv): Do Hangul transliteration here and increment
51+
result once for every transliterated character.
52+
* src/johab_hangul.h (johab_hangul_decompose): Change result array
53+
from 'unsigned char*' to 'wchar_t*'.
54+
55+
* src/cp1258.h (cp1258_mbtowc): Return RET_ILSEQ instead of storing
56+
0xfffd.
57+
58+
* src/georgian_ps.h (georgian_ps_wctomb): Accept 0x00e6.
59+
60+
* src/euc_jp.h (euc_jp_wctomb): Don't treat U+005C and U+007E like
61+
Katakana.
62+
63+
* src/euc_tw.h (euc_tw_mbtowc): Fix typo.
64+
65+
* src/cp950.h (cp950_mbtowc, cp950_wctomb): Exclude the range
66+
0xC6A1..0xC7FE.
67+
68+
* tools/cjk_tab_to_h.c (read_table_ksc5601): Some Hangul range was
69+
not being excluded. Fix that.
70+
* src/ksc5601.h: Regenerated.
71+
* src/johab.h (johab_mbtowc): Don't accept 0xDA{A1..D3} - this is
72+
valid in KSC5601/KSX1001 but not in JOHAB.
73+
74+
* src/iconv.c (conv_struct): Add fields iindex, oindex.
75+
(iconv_open): Fill in iindex, oindex.
76+
77+
* src/encodings.def (UCS-2-BE): Add aliases "UNICODE-1-1" and
78+
"csUnicode11", from IANA charset list.
79+
(MacRoman): Add aliases "MAC" and "csMacintosh" for "MACINTOSH",
80+
from IANA charset list.
81+
(JIS_X0208): Add aliases "X0208", "ISO-IR-87", "csISO87JISX0208",
82+
from IANA charset list.
83+
(GB_2312-80): New encoding, from IANA charset list.
84+
85+
* README, man/iconv_open.3: Add MacIceland and MacUkraine.
86+
87+
* Makefile.devel: Add rules for src/aliases.h and src/aliases.gperf.
88+
(all): Depend on src/aliases.h.
89+
* src/Makefile.in: Remove rules for $(srcdir)/aliases.h and
90+
$(srcdir)/aliases.gperf.
91+
(clean): Clean up.
92+
93+
* src/Makefile.in (libiconv_plug_linux.so): Remove unneeded "-ldl".
94+
95+
1999-12-31 Bruno Haible <haible@clisp.cons.org>
96+
97+
* Version 0.3 released.
98+

Makefile.devel

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33

44
SHELL = /bin/sh
55
MAKE = make
6+
GPERF = gperf
7+
CC = gcc
8+
CFLAGS = -O
9+
CP = cp
10+
RM = rm -f
611

712

8-
all : configures src/config.h.msvc include/libiconv.h.msvc
13+
all : configures src/config.h.msvc include/libiconv.h.msvc src/aliases.h src/flags.h src/translit.h
914

1015

1116
# Before making a new release:
12-
# - check that the encoding lists in README and iconv_open.3 are up to date,
13-
# - increment the version number in libiconv.h.in.
17+
# - check that the encoding lists in README and man/iconv_open.3 are up to date,
18+
# - increment the version number in include/libiconv.h.in and README,
19+
# - update the version info in src/Makefile.in,
1420
# - do "make -f Makefile.devel".
1521

1622

@@ -43,4 +49,29 @@ include/libiconv.h.msvc : include/libiconv.h.in
4349
sed -e 's/@INCLUDE_ICONV_H@//g' -e 's/@HAVE_ICONV_H@/0/' -e 's/@ICONV_CONST@/const/g' < $< > $@
4450

4551

52+
# We use "-7" to make a smaller table, but use "unsigned char" array indices
53+
# to avoid gcc warning.
54+
src/aliases.h : src/aliases.gperf
55+
$(GPERF) -t -L ANSI-C -H aliases_hash -N aliases_lookup -7 -C -k '1,3-7,9-11,$$' src/aliases.gperf | sed -e 's/\[str/\[(unsigned char) str/' > tmp.h
56+
$(CP) tmp.h src/aliases.h
57+
$(RM) tmp.h
58+
59+
src/aliases.gperf : src/encodings.def src/genaliases.c
60+
$(CC) $(CFLAGS) src/genaliases.c -o genaliases
61+
./genaliases > src/aliases.gperf
62+
$(RM) genaliases
63+
64+
65+
src/flags.h : src/converters.h src/genflags.c
66+
$(CC) $(CFLAGS) src/genflags.c -o genflags
67+
./genflags > src/flags.h
68+
$(RM) genflags
69+
70+
71+
src/translit.h : src/translit.def src/gentranslit.c
72+
$(CC) $(CFLAGS) src/gentranslit.c -o gentranslit
73+
./gentranslit < src/translit.def > src/translit.h
74+
$(RM) gentranslit
75+
76+
4677
force :

Makefile.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ SHELL = /bin/sh
2929
all : force
3030
cd src; $(MAKE) -r all
3131
cd man; $(MAKE) -r all
32+
if test -d tests; then cd tests; $(MAKE) -r all; fi
3233

3334
# Installs the library and include files only. Typically called with only
3435
# $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here.
@@ -60,24 +61,29 @@ uninstall : force
6061
check : force
6162
cd src; $(MAKE) -r check
6263
cd man; $(MAKE) -r check
64+
if test -d tests; then cd tests; $(MAKE) -r check; fi
6365

6466
mostlyclean : force
6567
cd src; $(MAKE) -r mostlyclean
6668
cd man; $(MAKE) -r mostlyclean
69+
if test -d tests; then cd tests; $(MAKE) -r mostlyclean; fi
6770

6871
clean : force
6972
cd src; $(MAKE) -r clean
7073
cd man; $(MAKE) -r clean
74+
if test -d tests; then cd tests; $(MAKE) -r clean; fi
7175

7276
distclean : force
7377
cd src; if test -f Makefile; then $(MAKE) -r distclean; fi
7478
cd man; if test -f Makefile; then $(MAKE) -r distclean; fi
79+
if test -d tests; then cd tests; if test -f Makefile; then $(MAKE) -r distclean; fi; fi
7580
$(RM) config.status config.log config.cache Makefile libtool
7681
$(RM) include/libiconv.h
7782

7883
maintainer-clean : force
7984
cd src; if test -f Makefile; then $(MAKE) -r maintainer-clean; fi
8085
cd man; if test -f Makefile; then $(MAKE) -r maintainer-clean; fi
86+
if test -d tests; then cd tests; if test -f Makefile; then $(MAKE) -r maintainer-clean; fi; fi
8187
$(RM) config.status config.log config.cache Makefile libtool
8288
$(RM) include/libiconv.h
8389

NEWS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
New in 1.0:
2+
* Added transliteration facilities.
3+
* Added a test suite.
4+
* Fixed the iconv(3) manual page and function: the return value was not
5+
described correctly.
6+
* Fixed a bug in the CP1258 decoder: invalid bytes now yield EILSEQ instead of
7+
U+FFFD.
8+
* Fixed a bug in the Georgian-PS encoder: accept U+00E6.
9+
* Fixed a bug in the EUC-JP encoder: reject 0x8E5C and 0x8E7E.
10+
* Fixed a bug in the KSC5601 and JOHAB converters: they recognized some Hangul
11+
characters at some invalid code positions.
12+
* Fixed a bug in the EUC-TW decoder; it was severely broken.
13+
* Fixed a bug in the CP950 converter: it recognized a dubious BIG5 range.
14+
115
New in 0.3:
216
* Reduced the size of the tables needed for the JOHAB converter.
317
* Portability to Win32.

NOTES

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,14 @@ A: 1. Explain the "why" in this file, above.
295295
the new character set name, with the proper dimensions, but that shouldn't
296296
be too hard. This yields the CCS. The CES you have to write by hand.
297297
4. Store the resulting C code file in the src directory. Add a #include
298-
directive to iconv.c, and add an entry to the encodings.def file.
298+
directive to converters.h, and add an entry to the encodings.def file.
299299
5. Compile the package, and test your new encoding using a program like
300300
iconv(1) or clisp(1).
301-
6. Update the README and man3/iconv_open.3, to mention the new encoding.
301+
6. Augment the testsuite: Add a line to tests/Makefile.in. For a stateless
302+
encoding, create the complete table as a TXT file. For a stateful encoding,
303+
provide a text snippet encoded using your new encoding and its UTF-8
304+
equivalent.
305+
7. Update the README and man3/iconv_open.3, to mention the new encoding.
302306
Add a note in the NEWS file.
303307

304308
Q: What about bidirectional text? Should it be tagged or reversed when
@@ -311,7 +315,6 @@ A: After reading RFC 1556: I don't think so. Support for ISO-8859-8-I and
311315
the same as ISO-8859-8-I. I'm confused.
312316

313317
Other character sets not implemented:
314-
"macintosh" = "mac" = "csMacintosh"
315318
"MNEMONIC" = "csMnemonic"
316319
"MNEM" = "csMnem"
317320
"ISO-10646-UCS-Basic" = "csUnicodeASCII"
@@ -324,7 +327,22 @@ Other aliases not implemented (and not implemented in glibc-2.1 either):
324327
From MSIE4:
325328
ISO-8859-1: alias ISO8859-1
326329
ISO-8859-2: alias ISO8859-2
327-
GB2312: aliases CHINESE CSISO58GB231280 GB_2312-80 ISO-IR-58
328330
KSC_5601: alias KS_C_5601
329331
UTF-8: aliases UNICODE-1-1-UTF-8 UNICODE-2-0-UTF-8
330332

333+
334+
Q: How can I integrate libiconv into my package?
335+
A: Just copy the entire libiconv package into a subdirectory of your package.
336+
At configuration time, call libiconv's configure script with the
337+
appropriate --srcdir option and maybe --enable-static or --disable-shared.
338+
Then "cd libiconv && make && make install-lib libdir=... includedir=...".
339+
'install-lib' is a special (not GNU standardized) target which installs
340+
only the include file - in $(includedir) - and the library - in $(libdir) -
341+
and does not use other directory variables. After "installing" libiconv
342+
in your package's build directory, building of your package can proceed.
343+
344+
Q: Why is the testsuite so big?
345+
A: Because some of the tests are very comprehensive.
346+
If you don't feel like using the testsuite, you can simply remove the
347+
tests/ directory.
348+

README

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
LIBICONV - character set conversion library
2+
13
This library provides an iconv() implementation, for use on systems which
24
don't have one, or whose implementation cannot convert from/to Unicode.
35

@@ -6,7 +8,8 @@ It provides support for the encodings:
68
European languages
79
ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15}, KOI8-R, KOI8-U, KOI8-RU,
810
CP{1250,1251,1252,1253,1254,1257}, CP{850,866},
9-
Mac{Roman,CentralEurope,Croatian,Romania,Cyrillic,Greek,Turkish},
11+
Mac{Roman,CentralEurope,Iceland,Croatian,Romania},
12+
Mac{Cyrillic,Ukraine,Greek,Turkish},
1013
Macintosh
1114
Semitic languages
1215
ISO-8859-{6,8}, CP{1255,1256}, Mac{Hebrew,Arabic}
@@ -35,7 +38,9 @@ It provides support for the encodings:
3538
UCS-2-INTERNAL, UCS-4-INTERNAL
3639

3740
It can convert from any of these encodings to any other, through Unicode
38-
conversion.
41+
conversion. It has also some limited support for transliteration, i.e.
42+
when a character cannot be represented in the target character set, it can
43+
be approximated through one or several similarly looking characters.
3944

4045
libiconv is for you if your application needs to support multiple character
4146
encodings, but that support lacks from your system.
@@ -71,4 +76,12 @@ This library can be built and installed in two variants:
7176
A program's source need not be modified, the program need not even be
7277
recompiled. Just set the LD_PRELOAD environment variable, that's it!
7378

79+
80+
Distribution:
81+
ftp://ftp.ilog.fr/pub/Users/haible/gnu/libiconv-1.0.tar.gz
82+
83+
Homepage:
84+
http://clisp.cons.org/~haible/packages-libiconv.html
85+
86+
7487
Bruno Haible <haible@clisp.cons.org>

TODO

Lines changed: 0 additions & 1 deletion
This file was deleted.

configure

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,11 @@ else
17171717
fi
17181718

17191719

1720-
test -d include || mkdir include
1720+
if test -d "${srcdir}/tests"; then
1721+
TESTS_MAKEFILE=tests/Makefile
1722+
else
1723+
TESTS_MAKEFILE=""
1724+
fi
17211725
trap '' 1 2 15
17221726
cat > confcache <<\EOF
17231727
# This file is a shell script that caches the results of configure
@@ -1818,7 +1822,7 @@ done
18181822
18191823
ac_given_srcdir=$srcdir
18201824
1821-
trap 'rm -fr `echo "Makefile src/Makefile man/Makefile include/libiconv.h src/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1825+
trap 'rm -fr `echo "Makefile src/Makefile man/Makefile ${TESTS_MAKEFILE} include/libiconv.h src/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
18221826
EOF
18231827
cat >> $CONFIG_STATUS <<EOF
18241828
@@ -1912,7 +1916,7 @@ EOF
19121916

19131917
cat >> $CONFIG_STATUS <<EOF
19141918
1915-
CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile man/Makefile include/libiconv.h"}
1919+
CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile man/Makefile ${TESTS_MAKEFILE} include/libiconv.h"}
19161920
EOF
19171921
cat >> $CONFIG_STATUS <<\EOF
19181922
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then

configure.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dnl Copyright (C) 1999 Free Software Foundation, Inc.
1+
dnl Copyright (C) 1999-2000 Free Software Foundation, Inc.
22
dnl This file is part of the GNU ICONV Library.
33
dnl
44
dnl The GNU ICONV Library is free software; you can redistribute it and/or
@@ -87,5 +87,9 @@ else
8787
fi
8888
AC_SUBST(PLUGLIB)
8989

90-
test -d include || mkdir include
91-
AC_OUTPUT(Makefile src/Makefile man/Makefile include/libiconv.h)
90+
if test -d "${srcdir}/tests"; then
91+
TESTS_MAKEFILE=tests/Makefile
92+
else
93+
TESTS_MAKEFILE=""
94+
fi
95+
AC_OUTPUT(Makefile src/Makefile man/Makefile ${TESTS_MAKEFILE} include/libiconv.h)

include/libiconv.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 1999 Free Software Foundation, Inc.
1+
/* Copyright (C) 1999-2000 Free Software Foundation, Inc.
22
This file is part of the GNU ICONV Library.
33
44
The GNU ICONV Library is free software; you can redistribute it and/or
@@ -26,7 +26,7 @@
2626
#ifndef _LIBICONV_H
2727
#define _LIBICONV_H
2828

29-
#define _LIBICONV_VERSION 0x0003 /* version number: (major<<8) + minor */
29+
#define _LIBICONV_VERSION 0x0100 /* version number: (major<<8) + minor */
3030

3131
/* Include all possible include files which could define iconv_t. */
3232
/* The next line should include the system's <iconv.h> file. But if it

include/libiconv.h.msvc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 1999 Free Software Foundation, Inc.
1+
/* Copyright (C) 1999-2000 Free Software Foundation, Inc.
22
This file is part of the GNU ICONV Library.
33

44
The GNU ICONV Library is free software; you can redistribute it and/or
@@ -26,7 +26,7 @@
2626
#ifndef _LIBICONV_H
2727
#define _LIBICONV_H
2828

29-
#define _LIBICONV_VERSION 0x0003 /* version number: (major<<8) + minor */
29+
#define _LIBICONV_VERSION 0x0100 /* version number: (major<<8) + minor */
3030

3131
/* Include all possible include files which could define iconv_t. */
3232
/* The next line should include the system's <iconv.h> file. But if it

man/iconv.3

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
.\" GNU glibc-2 source code and manual
1010
.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
1111
.\"
12-
.TH ICONV 3 "November 27, 1999" "GNU" "Linux Programmer's Manual"
12+
.TH ICONV 3 "January 2, 2000" "GNU" "Linux Programmer's Manual"
1313
.SH NAME
1414
iconv \- perform character set conversion
1515
.SH SYNOPSIS
@@ -66,8 +66,9 @@ A third state is when \fIinbuf\fP is NULL or \fI*inbuf\fP is NULL, and
6666
\fIoutbuf\fP is NULL or \fI*outbuf\fP is NULL. In this case, the \fBiconv\fP
6767
function sets \fIcd\fP's conversion state to the initial state.
6868
.SH "RETURN VALUE"
69-
The \fBiconv\fP function returns the number of characters converted during
70-
this call. In case of error, it sets \fBerrno\fP and returns (iconv_t)(-1).
69+
The \fBiconv\fP function returns the number of characters converted in a
70+
non-reversible way during this call; reversible conversions are not counted.
71+
In case of error, it sets \fBerrno\fP and returns (iconv_t)(-1).
7172
.SH ERRORS
7273
The following errors can occur, among others:
7374
.TP

0 commit comments

Comments
 (0)