On Wed, Apr 28, 2021 at 01:44:03AM +0200, Eike Rathke wrote:
On Tuesday, 2021-04-27 10:17:29 -0700, Kevin J. McCarthy wrote:What if we added an allow_8bit parameter to the function, that also passed through bytes with the 8th bit set? I'd keep this set off in all other invocations except the mailcap invocations.Allowing *all* 8-bit may be ill advised. I'd disallow at least resulting U+0080 to U+009F Unicode control characters (C1 control codes). Also exclude the non-characters U+FFFE and U+FFFF. But, what text encoding are we actually talking about?
Answering the question first, Mutt will decode the RFC2231 parameters and convert them to $charset. It looks like the 2231 decoder does run values through mutt_filter_unprintable().
mutt_filter_unprintable() calls mbrtowc() to check for a valid sequence and then iswprint() to ensure the character is in the "print" class.
For the first part, I *think* that addresses your concern. But in any case, would those characters cause issues for a tempfile filename?
-- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature