From d925ac8f7247613e28325c01a6614c37e8cbc7a0 Mon Sep 17 00:00:00 2001 From: q3cpma Date: Mon, 1 Aug 2022 12:43:42 +0000 Subject: filters: make it explicit that encoding is UTF-8 Document filter input charset Add w3m filter example to default config Adapt html and html-unsafe filters Fixes: https://todo.sr.ht/~rjarry/aerc/65 Signed-off-by: q3cpma Acked-by: Robin Jarry --- config/aerc.conf | 1 + doc/aerc-config.5.scd | 3 +++ filters/html | 1 + filters/html-unsafe | 1 + 4 files changed, 6 insertions(+) diff --git a/config/aerc.conf b/config/aerc.conf index 3b7b5d60..fc6479af 100644 --- a/config/aerc.conf +++ b/config/aerc.conf @@ -292,6 +292,7 @@ reply-to-self=true #subject,~^\[PATCH=colordiff text/plain=sed 's/^>\+.*/\x1b[36m&\x1b[0m/' #text/html=pandoc -f html -t plain +#text/html=w3m -dump -I UTF-8 -T text/html #image/*=catimg -w $(tput cols) - [triggers] diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index c712c58f..aaf15b8a 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -497,6 +497,9 @@ aerc ships with some default filters installed in the share directory (usually _/usr/share/aerc/filters_). Note that these may have additional dependencies that aerc does not have alone. +Note that said email body is converted into UTF-8 before being passed to +filters. + ## TRIGGERS Triggers specify commands to execute when certain events occur. diff --git a/filters/html b/filters/html index db7808ac..5ceee401 100755 --- a/filters/html +++ b/filters/html @@ -3,6 +3,7 @@ # any phoning home by rendered emails export SOCKS_SERVER="127.0.0.1:1" exec socksify w3m \ + -I UTF-8 \ -T text/html \ -cols $(tput cols) \ -dump \ diff --git a/filters/html-unsafe b/filters/html-unsafe index 6dce27e2..8e0041c5 100755 --- a/filters/html-unsafe +++ b/filters/html-unsafe @@ -9,6 +9,7 @@ else PRE_CMD="" fi exec $PRE_CMD w3m \ + -I UTF-8 \ -T text/html \ -cols $(tput cols) \ -dump \ -- cgit