set conversion.
auxexecdir="$(auxexecdir)" bindir="$(bindir)" \
mandir="$(mandir)" sysconfdir="$(sysconfdir)" \
MULTIBYTE_ENABLED=$(MULTIBYTE_ENABLED) \
+ ICONV_ENABLED=$(ICONV_ENABLED) \
$(TESTS_SHELL) ## Keep at end of TESTS_ENVIRONMENT.
##
## Important note: the "cleanup" test should always be last
AS_IF([test "x$nmh_found_iconv" = "xyes"], [ICONVLIB="-liconv"])])
dnl If we came out of that by finding iconv in some form, define
dnl HAVE_ICONV
+ ICONV_ENABLED=0
AS_IF([test "x$nmh_found_iconv" = "xyes"],
[AC_DEFINE([HAVE_ICONV], [1],
[Define if you have the iconv() function.])
+ ICONV_ENABLED=1
AC_CACHE_CHECK([for iconv declaration], [nmh_cv_iconv_const],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
#include <iconv.h>]],
AC_DEFINE_UNQUOTED([ICONV_CONST], [$nmh_cv_iconv_const],
[Define as const if the declaration of iconv() needs const.])])])
AC_SUBST([ICONVLIB])])
+AC_SUBST([ICONV_ENABLED])
test -z "$mandir" && mandir="@mandir@"
test -z "$sysconfdir" && sysconfdir="@sysconfdir@"
test -z "$MULTIBYTE_ENABLED" && MULTIBYTE_ENABLED="@MULTIBYTE_ENABLED@"
+test -z "$ICONV_ENABLED" && ICONV_ENABLED="@ICONV_ENABLED@"
export MH_TEST_DIR auxexecdir bindir mandir sysconfdir
-export MULTIBYTE_ENABLED
+export MULTIBYTE_ENABLED ICONV_ENABLED
test -z "$MH_INST_DIR" && MH_INST_DIR="${MH_TEST_DIR}/inst"
export MH_INST_DIR
scan -width 80 +inbox 11 > $actual || exit 1
check "$expected" "$actual"
-# check decoding with an invalid multibyte sequence
-cat >`mhpath new` <<EOF
+#
+# Check decoding with an invalid multibyte sequence. We skip this test
+# if we don't have iconv support, since it requires converting from one
+# character set to another
+#
+
+if test "$ICONV_ENABLED" -eq 1; then
+ cat >`mhpath new` <<EOF
From: Test12 <test12@example.com>
To: Some User <user@example.com>
Date: Mon, 31 Dec 2012 00:00:00
ISO-8859-1 character set, but it (U+2019) is valid UTF-8.
EOF
-cat >"$expected" <<EOF
+ cat >"$expected" <<EOF
12 12/31 Test12 2013 New Year?s Deals! Start the year right
EOF
-LC_CTYPE=ISO-8859-1 MM_CHARSET=ISO-8859-1 scan -width 75 last >"$actual"
-check "$expected" "$actual"
+ LC_CTYPE=ISO-8859-1 MM_CHARSET=ISO-8859-1 scan -width 75 last >"$actual"
+ check "$expected" "$actual"
+fi
# check scan width with a valid multibyte sequence
cat >"$expected" <<EOF