nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] mhshow/test-charset failures in nmh-1.7 (`Can't convert ?us-ascii to UTF-8')

2017-11-24 17:44:45
Leonardo wrote:

(But, I think that this shouldn't matter according my code reading
of relevant parts of nmh test suite because the test suite correctly
inject them in the environment.)

Yes, that was the intent.

And, with NetBSD iconv(1) I have:

 % printf '\xe4' | /usr/bin/iconv -f EBCDIC-US -t UTF-8
 U

Same here with GNU iconv(1) on Linux.

...while with iconv(1) provided by the `libiconv' package:

 % printf '\xe4' | /usr/pkg/bin/iconv -f EBCDIC-US -t UTF-8
 /usr/pkg/bin/iconv: conversion from EBCDIC-US unsupported
 /usr/pkg/bin/iconv: try '/usr/pkg/bin/iconv -l' to get the list of supported 
encodings
 % echo $?
 1

So, in if GNU iconv(1) is available `$skip_param_value_checks' is
set to 1.

OK, the reason is that EBCDIC-US isn't known.  Does /usr/pkg/bin/iconv -l
list another suitable character encoding, such as EBCDIC-UK?  The test
uses an EBCDIC encoding to show that it really does a non-trivial
translation, but it could use a different one.

I'm now curious if apart FreeBSD and NetBSD with `libiconv' package
installed what happens on other platforms, just checking the exit status
of: >
 $ printf '\xe4' | iconv -f EBCDIC-US -t UTF-8

will be probably enough.

I get the same result as you:  U with 0 exit status.

If the exit status is 0 and then, in test-charset context
`$skip_param_value_checks' is 0, what happens if you try (this is
stolen entirely from 'replacement character in parameter value'
test in test-charset):

 $ printf "Subject: invalid parameter value charset\nMIME-Version: 
1.0\nContent-Type: text/plain; charset*=invalid''%%0Dus-ascii\n" | \
 mhshow -file - | cat

Here, I have:

| Subject: invalid parameter value charset
| 
| mhshow: Can't convert ?us-ascii to UTF-8
| mhshow: unable to convert character set from ?us-ascii, continuing...
| [ part  - text/plain -   0B  ]

That was the intent, too.  Based on Ralph's (re-?)discovery that the charset
name gets normalised by GNU iconv, I see now why the test behaved differently
on the FreeBSD 10 buildbot.

I reworked test-charset to reflect that.  It still uses EBCDIC-US.

David

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

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