#
# - Put the path to this program in your .mh_profile under formatproc:
#
-# formatproc: replyfilter
+# formatproc: replyfilter
#
-# - Create a mhl reply filter that consists of the following line:
+# or invoke repl with "-fmtproc replyfilter".
#
-# body:nocomponent,format,nowrap,formatarg="%(trim{content-type})%(putstr)",formatarg="%(trim{content-transfer-encoding})%(putstr)",formatarg=">"
+# - Create an mhl reply filter that consists of the following line:
+#
+# body:nocomponent,format,nowrap,formatarg="%(trim{content-type})%(putstr)",formatarg="%(trim{content-transfer-encoding})%(putstr)",formatarg=">"
+#
+# By default, repl will look for the mhl reply filter by the name
+# "mhl.reply", but it will look elsewhere if the -filter switch is given.
#
# To decode this a bit:
#
# component prefix of ">" as a quote character, but we're
# going to have replyfilter do that).
# nowrap - Don't wrap lines if they exceed the column width
-# formatarg - Arguments to fmtproc. The first argument is the value of
-# the Content-type header; the second is the value of the
+# formatarg - Arguments to formatproc. The first argument is the value
+# of the Content-type header; the second is the value of the
# Content-Transfer-Encoding header. The last "formatarg"
# is used as your quoting prefix. Replace it with whatever
# you want.
$maxcolwidth = 78;
#
-# Out HTML converter program & arguments
+# Out HTML converter program & arguments. charset will be appended
#
@htmlconv = ('w3m', '-dump', '-cols', $maxcolwidth - 2, '-T', 'text/html',
- '-O', $outcharset);
+ '-O', $outcharset, '-I');
die "Usage: $0 Content-type content-transfer-encoding quote-prefix\n"
binmode($input, ':encoding(us-ascii)');
- $decoder = find_decoder($encoding);
+ $decoder = find_decoder(lc($encoding));
if (! defined $decoder) {
return 'EOF';
}
my $filterpid, $prefixpid, $finread, $finwrite;
my $foutread, $foutwrite, $decoder, $ret;
- if (! defined($decoder = find_decoder($encoding))) {
+ if (! defined($decoder = find_decoder(lc($encoding)))) {
return 'EOF';
}
# Exec our converter
#
- exec (@htmlconv) ||
+ my @conv = (@htmlconv, $charset);
+ exec (@conv) ||
die "Unable to exec $filterprogram: $!\n";
} else {
die "Fork for $htmlconv[0] failed: $!\n";
$charset = 'us-ascii';
}
- $encoding = defined $cte ? $cte->param('_') : '7bit';
+ $encoding = defined $cte ? lc($cte->param('_')) : '7bit';
$name = defined $cdispo ? $cdispo->param('filename') : undef;
#