Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text encoding for external filter #59

Closed
xunam opened this issue Jun 8, 2020 · 4 comments
Closed

text encoding for external filter #59

xunam opened this issue Jun 8, 2020 · 4 comments

Comments

@xunam
Copy link

xunam commented Jun 8, 2020

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
Copy link
Author

xunam commented Jun 10, 2020

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
Copy link
Owner

wangp commented Jun 10, 2020

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

@xunam
Copy link
Author

xunam commented Jun 10, 2020

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

@wangp wangp closed this as completed in fbaff04 Jun 21, 2020
@wangp
Copy link
Owner

wangp commented Jun 21, 2020

The environment variables are PART_CONTENT_TYPE and PART_CHARSET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants