nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Where are we at for 1.7.1?

2018-01-30 11:03:04
Hi Andy,

To recap, the previous mailing-list discussion was around
http://lists.nongnu.org/archive/html/nmh-workers/2018-01/msg00130.html
and
http://lists.nongnu.org/archive/html/nmh-workers/2018-01/msg00126.html
The former's suggestion, with correction, got committed as 695ed941.

if [ $iconv_elides_question_marks -eq 1 ]; then
    check "$expected" "$actual"
else
    grep "Can't convert .*us-ascii to UTF-8" "$actual" >/dev/null  ||  
failed=1
fi

It enters the else because iconv_elides_question_marks was previously
set to 0 and never altered thereafter.

That's this early part.  Does it attempt the printf?  If so,
$ICONV_ENABLED isn't 0, and iconv(1) quite reasonably disliked
converting from `?UTF-8'.

    iconv_elides_question_marks=0
    if test "$ICONV_ENABLED" -eq 0; then
        text_size=10
    else
        text_size=11
        #### The GNU iconv library normalises charset names by eliding '?', 
along
        #### with some other characters.  The iconv library used on 
FreeBSD/NetBSD
        #### doesn't.
        printf x | iconv -f '?UTF-8' -t UTF-8 >/dev/null 2>&1  &&
            iconv_elides_question_marks=1
    fi

So, why does it expect an error in $actual under these conditions?
...
$ cat $MHTMPDIR/inbox/$msgnum                                     
Subject: invalid parameter value charset
MIME-Version: 1.0
Content-Type: text/plain; charset*=invalid''%0Dus-ascii

It expects an error because the charset is invalid.  The parameter's
value is in the `invalid' character set, with no specified language, and
it is a carriage return followed by `us-ascii'.

Because iconv_elides_question_marks is 0 it's expected that iconv will
choke on the parameter, giving an error message to be found by the grep.

$ env | grep LC

(locale(1) is a better test because there's $LANG too.)

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy

-- 
Nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>