wangp / bower

A curses terminal client for the Notmuch email system
Other
119 stars 11 forks source link

text encoding for external filter #59

Closed xunam closed 4 years ago

xunam commented 4 years ago

Hello,

Message parts that are sent to external filters are sent without charset conversion but there seems to be no way to inform the filter of the charset it receives.

Consequence: filtering a text/html part in ISO-8859-1 through Pandoc makes it crash, since it only accepts UTF-8 input, and there is no way to iconv the data first to fix this.

xunam commented 4 years ago

Come to think of it, why not use .mailcap in the first place ? It provides the same functionality as bower's open_part and filter configuration but in a way that is already well established and thought out. It is certainly some work to implement it but there might be libraries for that.

wangp commented 4 years ago

The obvious thing would be to pass the content-type and charset through environment variables. Rather not deal with mailcap.

xunam commented 4 years ago

indeed, that seems to be the right solution assuming mailcap is not used (which can be argued for).

wangp commented 4 years ago

The environment variables are PART_CONTENT_TYPE and PART_CHARSET.