Skip to content

Commit

Permalink
Upgrade to libiconv-1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaible committed Jan 4, 2000
1 parent 3af9cd3 commit 00e960f
Show file tree
Hide file tree
Showing 129 changed files with 155,959 additions and 973 deletions.
98 changes: 98 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
2000-01-04 Bruno Haible <haible@clisp.cons.org>

* Version 1.0 released.
* include/libiconv.h.in (_LIBICONV_VERSION): Bump version number.
* src/Makefile.in (LIBICONV_VERSION_INFO): Define to 0:1:0.
(libiconv.la): Use LIBICONV_VERSION_INFO.

2000-01-03 Bruno Haible <haible@clisp.cons.org>

* tests/Makefile.in: New file.
tests/check-stateless, tests/table-from.c, tests/table-to.c,
tests/*.TXT, tests/genutf8.c: New files, checks for stateless
encodings.
tests/check-stateful, tests/iconv.c, tests/*-snippet*: New files,
checks for stateful encodings.
* Makefile.in (all, check, mostlyclean, clean, distclean,
maintainer-clean): Descend into tests directory.
* configure.in: Add tests/Makefile to AC_OUTPUT duties.

* src/gentranslit.c: New file.
* Makefile.devel (src/translit.h): New rule.
* src/translit.def, src/translit.h: New files.
* src/iconv.c: Include it.
(iconv): Transliterate using translit.h table.

* src/genflags.c: New file.
* Makefile.devel (src/flags.h): New rule.
* src/flags.h: New file.
* src/iconv.c: Include it.
(encoding): Add field 'oflags'.
(all_encodings): Initialize the field 'oflags'.
(iconv_open): Copy field 'oflags'.
(iconv): Transliterate quotation marks U+2018, U+2019, U+201A.
* src/Makefile.in (iconv.lo): Update dependencies.

* src/converters.h: New file, extracted from src/iconv.c.
* src/iconv.c: Include it.
* src/Makefile.in (iconv.lo): Update dependencies.

* tools/cjk_variants.c: New file.
* tools/Makefile (ALL): Add cjk_variants.h.
(cjk_variants.h, cjk_variants): New rules.
* src/cjk_variants.h: New file.
* src/iconv.c: Include it.
(iconv): Use cjk_variants for transliteration.

* man/iconv.3: Fix description of return value.
* euc_kr.h (euc_kr_wctomb): Remove Hangul transliteration.
* iso2022_kr.h (iso2022kr_wctomb): Likewise.
* src/iconv.c (iconv): Do Hangul transliteration here and increment
result once for every transliterated character.
* src/johab_hangul.h (johab_hangul_decompose): Change result array
from 'unsigned char*' to 'wchar_t*'.

* src/cp1258.h (cp1258_mbtowc): Return RET_ILSEQ instead of storing
0xfffd.

* src/georgian_ps.h (georgian_ps_wctomb): Accept 0x00e6.

* src/euc_jp.h (euc_jp_wctomb): Don't treat U+005C and U+007E like
Katakana.

* src/euc_tw.h (euc_tw_mbtowc): Fix typo.

* src/cp950.h (cp950_mbtowc, cp950_wctomb): Exclude the range
0xC6A1..0xC7FE.

* tools/cjk_tab_to_h.c (read_table_ksc5601): Some Hangul range was
not being excluded. Fix that.
* src/ksc5601.h: Regenerated.
* src/johab.h (johab_mbtowc): Don't accept 0xDA{A1..D3} - this is
valid in KSC5601/KSX1001 but not in JOHAB.

* src/iconv.c (conv_struct): Add fields iindex, oindex.
(iconv_open): Fill in iindex, oindex.

* src/encodings.def (UCS-2-BE): Add aliases "UNICODE-1-1" and
"csUnicode11", from IANA charset list.
(MacRoman): Add aliases "MAC" and "csMacintosh" for "MACINTOSH",
from IANA charset list.
(JIS_X0208): Add aliases "X0208", "ISO-IR-87", "csISO87JISX0208",
from IANA charset list.
(GB_2312-80): New encoding, from IANA charset list.

* README, man/iconv_open.3: Add MacIceland and MacUkraine.

* Makefile.devel: Add rules for src/aliases.h and src/aliases.gperf.
(all): Depend on src/aliases.h.
* src/Makefile.in: Remove rules for $(srcdir)/aliases.h and
$(srcdir)/aliases.gperf.
(clean): Clean up.

* src/Makefile.in (libiconv_plug_linux.so): Remove unneeded "-ldl".

1999-12-31 Bruno Haible <haible@clisp.cons.org>

* Version 0.3 released.

37 changes: 34 additions & 3 deletions Makefile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@

SHELL = /bin/sh
MAKE = make
GPERF = gperf
CC = gcc
CFLAGS = -O
CP = cp
RM = rm -f


all : configures src/config.h.msvc include/libiconv.h.msvc
all : configures src/config.h.msvc include/libiconv.h.msvc src/aliases.h src/flags.h src/translit.h


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


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


# We use "-7" to make a smaller table, but use "unsigned char" array indices
# to avoid gcc warning.
src/aliases.h : src/aliases.gperf
$(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
$(CP) tmp.h src/aliases.h
$(RM) tmp.h

src/aliases.gperf : src/encodings.def src/genaliases.c
$(CC) $(CFLAGS) src/genaliases.c -o genaliases
./genaliases > src/aliases.gperf
$(RM) genaliases


src/flags.h : src/converters.h src/genflags.c
$(CC) $(CFLAGS) src/genflags.c -o genflags
./genflags > src/flags.h
$(RM) genflags


src/translit.h : src/translit.def src/gentranslit.c
$(CC) $(CFLAGS) src/gentranslit.c -o gentranslit
./gentranslit < src/translit.def > src/translit.h
$(RM) gentranslit


force :
6 changes: 6 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ SHELL = /bin/sh
all : force
cd src; $(MAKE) -r all
cd man; $(MAKE) -r all
if test -d tests; then cd tests; $(MAKE) -r all; fi

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

mostlyclean : force
cd src; $(MAKE) -r mostlyclean
cd man; $(MAKE) -r mostlyclean
if test -d tests; then cd tests; $(MAKE) -r mostlyclean; fi

clean : force
cd src; $(MAKE) -r clean
cd man; $(MAKE) -r clean
if test -d tests; then cd tests; $(MAKE) -r clean; fi

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

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

Expand Down
14 changes: 14 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
New in 1.0:
* Added transliteration facilities.
* Added a test suite.
* Fixed the iconv(3) manual page and function: the return value was not
described correctly.
* Fixed a bug in the CP1258 decoder: invalid bytes now yield EILSEQ instead of
U+FFFD.
* Fixed a bug in the Georgian-PS encoder: accept U+00E6.
* Fixed a bug in the EUC-JP encoder: reject 0x8E5C and 0x8E7E.
* Fixed a bug in the KSC5601 and JOHAB converters: they recognized some Hangul
characters at some invalid code positions.
* Fixed a bug in the EUC-TW decoder; it was severely broken.
* Fixed a bug in the CP950 converter: it recognized a dubious BIG5 range.

New in 0.3:
* Reduced the size of the tables needed for the JOHAB converter.
* Portability to Win32.
Expand Down
26 changes: 22 additions & 4 deletions NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,14 @@ A: 1. Explain the "why" in this file, above.
the new character set name, with the proper dimensions, but that shouldn't
be too hard. This yields the CCS. The CES you have to write by hand.
4. Store the resulting C code file in the src directory. Add a #include
directive to iconv.c, and add an entry to the encodings.def file.
directive to converters.h, and add an entry to the encodings.def file.
5. Compile the package, and test your new encoding using a program like
iconv(1) or clisp(1).
6. Update the README and man3/iconv_open.3, to mention the new encoding.
6. Augment the testsuite: Add a line to tests/Makefile.in. For a stateless
encoding, create the complete table as a TXT file. For a stateful encoding,
provide a text snippet encoded using your new encoding and its UTF-8
equivalent.
7. Update the README and man3/iconv_open.3, to mention the new encoding.
Add a note in the NEWS file.

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

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


Q: How can I integrate libiconv into my package?
A: Just copy the entire libiconv package into a subdirectory of your package.
At configuration time, call libiconv's configure script with the
appropriate --srcdir option and maybe --enable-static or --disable-shared.
Then "cd libiconv && make && make install-lib libdir=... includedir=...".
'install-lib' is a special (not GNU standardized) target which installs
only the include file - in $(includedir) - and the library - in $(libdir) -
and does not use other directory variables. After "installing" libiconv
in your package's build directory, building of your package can proceed.

Q: Why is the testsuite so big?
A: Because some of the tests are very comprehensive.
If you don't feel like using the testsuite, you can simply remove the
tests/ directory.

17 changes: 15 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
LIBICONV - character set conversion library

This library provides an iconv() implementation, for use on systems which
don't have one, or whose implementation cannot convert from/to Unicode.

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

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

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


Distribution:
ftp://ftp.ilog.fr/pub/Users/haible/gnu/libiconv-1.0.tar.gz

Homepage:
http://clisp.cons.org/~haible/packages-libiconv.html


Bruno Haible <haible@clisp.cons.org>
1 change: 0 additions & 1 deletion TODO

This file was deleted.

10 changes: 7 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,11 @@ else
fi


test -d include || mkdir include
if test -d "${srcdir}/tests"; then
TESTS_MAKEFILE=tests/Makefile
else
TESTS_MAKEFILE=""
fi
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
Expand Down Expand Up @@ -1818,7 +1822,7 @@ done
ac_given_srcdir=$srcdir
trap 'rm -fr `echo "Makefile src/Makefile man/Makefile include/libiconv.h src/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
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
EOF
cat >> $CONFIG_STATUS <<EOF
Expand Down Expand Up @@ -1912,7 +1916,7 @@ EOF

cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile man/Makefile include/libiconv.h"}
CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile man/Makefile ${TESTS_MAKEFILE} include/libiconv.h"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
Expand Down
10 changes: 7 additions & 3 deletions configure.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dnl Copyright (C) 1999 Free Software Foundation, Inc.
dnl Copyright (C) 1999-2000 Free Software Foundation, Inc.
dnl This file is part of the GNU ICONV Library.
dnl
dnl The GNU ICONV Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -87,5 +87,9 @@ else
fi
AC_SUBST(PLUGLIB)

test -d include || mkdir include
AC_OUTPUT(Makefile src/Makefile man/Makefile include/libiconv.h)
if test -d "${srcdir}/tests"; then
TESTS_MAKEFILE=tests/Makefile
else
TESTS_MAKEFILE=""
fi
AC_OUTPUT(Makefile src/Makefile man/Makefile ${TESTS_MAKEFILE} include/libiconv.h)
4 changes: 2 additions & 2 deletions include/libiconv.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1999 Free Software Foundation, Inc.
/* Copyright (C) 1999-2000 Free Software Foundation, Inc.
This file is part of the GNU ICONV Library.

The GNU ICONV Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -26,7 +26,7 @@
#ifndef _LIBICONV_H
#define _LIBICONV_H

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

/* Include all possible include files which could define iconv_t. */
/* The next line should include the system's <iconv.h> file. But if it
Expand Down
4 changes: 2 additions & 2 deletions include/libiconv.h.msvc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1999 Free Software Foundation, Inc.
/* Copyright (C) 1999-2000 Free Software Foundation, Inc.
This file is part of the GNU ICONV Library.

The GNU ICONV Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -26,7 +26,7 @@
#ifndef _LIBICONV_H
#define _LIBICONV_H

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

/* Include all possible include files which could define iconv_t. */
/* The next line should include the system's <iconv.h> file. But if it
Expand Down
7 changes: 4 additions & 3 deletions man/iconv.3
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.\" GNU glibc-2 source code and manual
.\" OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
.\"
.TH ICONV 3 "November 27, 1999" "GNU" "Linux Programmer's Manual"
.TH ICONV 3 "January 2, 2000" "GNU" "Linux Programmer's Manual"
.SH NAME
iconv \- perform character set conversion
.SH SYNOPSIS
Expand Down Expand Up @@ -66,8 +66,9 @@ A third state is when \fIinbuf\fP is NULL or \fI*inbuf\fP is NULL, and
\fIoutbuf\fP is NULL or \fI*outbuf\fP is NULL. In this case, the \fBiconv\fP
function sets \fIcd\fP's conversion state to the initial state.
.SH "RETURN VALUE"
The \fBiconv\fP function returns the number of characters converted during
this call. In case of error, it sets \fBerrno\fP and returns (iconv_t)(-1).
The \fBiconv\fP function returns the number of characters converted in a
non-reversible way during this call; reversible conversions are not counted.
In case of error, it sets \fBerrno\fP and returns (iconv_t)(-1).
.SH ERRORS
The following errors can occur, among others:
.TP
Expand Down
Loading

0 comments on commit 00e960f

Please sign in to comment.