Commit 3efaee8d authored by Lars Hecking's avatar Lars Hecking

patch.1.3.28.lh.noiconv

 =======================

 This is the new version of my noiconv patch. It _requires_ the previous
 patch! If applied without, you'll have to resolve a couple of conflicts
 manually.

 Notes:
 - it's a lot cleaner than the old noiconv patch because no m4 files are
   modified
 - new configure option --disable-iconv; INSTALL updated accordingly
   [I am guessing here, but the background for the --without-iconv option
    mentioned in INSTALL was that mutt had a without-iconv option before
    gettext included iconv support. When mutt's intl/* files were updated
    to a newer gettext, there suddenly were two iconv options, which then
    got merged, that is, mutt's was removed. That was probably when
    --without-iconv stopped working, but I'm not sure, it may well be that
    it never worked since iconv support was introduced.]
 - all changes in *.[ch] files should be identical to the old patch
parent b99364c5
......@@ -237,7 +237,7 @@ into your system's global Muttrc, which normally resides in /etc or
/usr/local/etc.
If you really want to, you can configure Mutt --without-iconv, but
If you really want to, you can configure Mutt using --diable-iconv, but
there will then be no character set conversion.
......
......@@ -31,8 +31,6 @@
#include <unistd.h>
#include <errno.h>
#include <iconv.h>
#include "mutt.h"
#include "charset.h"
......
......@@ -19,7 +19,19 @@
#ifndef _CHARSET_H
#define _CHARSET_H
#ifdef HAVE_ICONV_H
#include <iconv.h>
#endif
#ifndef HAVE_ICONV_T_DEF
typedef void *iconv_t;
#endif
#ifndef HAVE_ICONV
iconv_t iconv_open (const char *, const char *);
size_t iconv (iconv_t, const char **, size_t *, char **, size_t *);
int iconv_close (iconv_t);
#endif
int mutt_convert_string (char **, const char *, const char *, int);
......
......@@ -665,11 +665,17 @@ AC_SUBST(LIBIMAPDEPS)
dnl -- iconv/gettext --
AC_ARG_ENABLE(iconv, [ --disable-iconv Disable iconv support],
[ if test x$enableval = xno ; then
am_cv_func_iconv=no
fi
])
AM_GNU_GETTEXT
if test "$am_cv_func_iconv" != "yes"
then
AC_MSG_ERROR([Unable to find an iconv function. See INSTALL for help])
fi
AC_MSG_WARN([Unable to find an iconv function. See INSTALL for help])
else
dnl (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
dnl (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
......@@ -736,6 +742,8 @@ else
AC_DEFINE(ICONV_NONTRANS, 0)
fi
fi # libiconv
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/intl"
if test "$BUILD_INCLUDED_LIBINTL" = "yes"; then
......
......@@ -44,7 +44,6 @@
#include "mutt.h"
#include "pgp.h"
#include "charset.h"
#include "iconv.h"
/* for hexval */
#include "mime.h"
......
......@@ -2469,7 +2469,9 @@ struct command_t Commands[] = {
{ "fcc-save-hook", mutt_parse_hook, M_FCCHOOK | M_SAVEHOOK },
{ "folder-hook", mutt_parse_hook, M_FOLDERHOOK },
{ "hdr_order", parse_list, UL &HeaderOrderList },
#ifdef HAVE_ICONV
{ "iconv-hook", mutt_parse_hook, M_ICONVHOOK },
#endif
{ "ignore", parse_ignore, 0 },
{ "lists", parse_list, UL &MailLists },
{ "macro", mutt_parse_macro, 0 },
......
......@@ -24,7 +24,6 @@
#include <ctype.h>
#include <errno.h>
#include <iconv.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -671,6 +671,7 @@ static size_t convert_file_to (FILE *file, const char *fromcode,
int ncodes, const char **tocodes,
int *tocode, CONTENT *info)
{
#ifdef HAVE_ICONV
iconv_t cd1, *cd;
char bufi[256], bufu[512], bufo[4 * sizeof (bufi)];
ICONV_CONST char *ib, *ub;
......@@ -795,6 +796,9 @@ static size_t convert_file_to (FILE *file, const char *fromcode,
safe_free ((void **) &states);
return ret;
#else
return -1;
#endif /* !HAVE_ICONV */
}
/*
......
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