Commit 555629c0 authored by Bruno Haible's avatar Bruno Haible
Browse files

Work around iconv_open problem on Solaris.

parent 53181ad5
2009-08-30 Bruno Haible <bruno@clisp.org>
Work around iconv_open problem on Solaris.
* lib/iconv_open-solaris.gperf: New file.
* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Also handle Solaris.
* modules/iconv_open (Files): Add lib/iconv_open-solaris.gperf.
(Makefile.am): Add rule for iconv_open-solaris.h. Augment
BUILT_SOURCES, MOSTLYCLEANFILES, MAINTAINERCLEANFILES, EXTRA_DIST.
* doc/posix-functions/iconv_open.texi: Mention the Solaris problem.
2009-08-29 Jim Meyering <meyering@redhat.com>
 
maint.mk: remove more coreutils-specific targets; XZ_OPT=-9ev
......@@ -20,7 +20,7 @@ Portability problems fixed by Gnulib module @code{iconv_open}:
@item
This function recognizes only non-standard aliases for many encodings (not
the IANA registered encoding names) on many platforms:
AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1.
AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10.
@end itemize
Portability problems fixed by Gnulib module @code{iconv_open-utf}:
......
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
%struct-type
%language=ANSI-C
%define slot-name standard_name
%define hash-function-name mapping_hash
%define lookup-function-name mapping_lookup
%readonly-tables
%global-table
%define word-array-name mappings
%pic
%%
# On Solaris 10, look in the "iconv -l" output. Some aliases are advertised but
# not actually supported by the iconv() function and by the 'iconv' program.
# For example:
# $ echo abc | iconv -f 646 -t ISO-8859-1
# Not supported 646 to ISO-8859-1
# $ echo abc | iconv -f 646 -t ISO8859-1
$ abc
ASCII, "646"
ISO-8859-1, "ISO8859-1"
ISO-8859-2, "ISO8859-2"
ISO-8859-3, "ISO8859-3"
ISO-8859-4, "ISO8859-4"
ISO-8859-5, "ISO8859-5"
ISO-8859-6, "ISO8859-6"
ISO-8859-7, "ISO8859-7"
ISO-8859-8, "ISO8859-8"
ISO-8859-9, "ISO8859-9"
ISO-8859-15, "ISO8859-15"
CP1251, "ansi-1251"
# iconv_open.m4 serial 5
# iconv_open.m4 serial 6
dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
......@@ -21,10 +21,11 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
if test $gl_func_iconv_gnu = no; then
iconv_flavor=
case "$host_os" in
aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
esac
if test -n "$iconv_flavor"; then
AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor],
......
......@@ -8,6 +8,7 @@ lib/iconv_open-aix.gperf
lib/iconv_open-hpux.gperf
lib/iconv_open-irix.gperf
lib/iconv_open-osf.gperf
lib/iconv_open-solaris.gperf
m4/iconv_h.m4
m4/iconv_open.m4
......@@ -54,10 +55,13 @@ iconv_open-irix.h: iconv_open-irix.gperf
iconv_open-osf.h: iconv_open-osf.gperf
$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t
mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h
MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t
MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h
EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h
iconv_open-solaris.h: iconv_open-solaris.gperf
$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t
mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t
MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
Include:
<iconv.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment