tAdd heuristics for HTML charset in title. - sfeed_sendmail - sfeed to sendmail command
(HTM) git clone git://r-36.net/sfeed_sendmail
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit e5a2e13975215e9fd9d7056cb4383011cf196418
(DIR) parent f67f86e137dfc405b892e6a8a003ff649216a5e8
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sat, 10 Oct 2020 16:27:48 +0200
Add heuristics for HTML charset in title.
Diffstat:
sfeed_sendmail | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/sfeed_sendmail b/sfeed_sendmail
t@@ -26,7 +26,19 @@ do
[ -z "${timestamp}" ] && timestamp="$(TZ=UTC date +%s)"
timestamp="$(TZ=UTC date -R -d @${timestamp})"
- [ -z "${title}" ] && title="$(printf "%s\n" "${content}" | cut -b 30-)"
+
+ case "${title}" in
+ *\;*)
+ # HTML encoding in title.
+ title="$(printf "%s\n" "${title}" \
+ | lynx -dump -stdin -nomargins \
+ -display_charset="utf-8" \
+ -image_links \
+ -assume_charset="utf-8")"
+ ;;
+ esac
+ [ -z "${title}" ] && title="${link}"
+
case "${author}" in
*@*)
fromaddr="${author}"