From bdab033e7e69d1594fa0922c71c8c3df9170ab05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=84min=20Baumeler?= Date: Wed, 18 Mar 2026 22:02:52 +0100 Subject: [PATCH] bugfix: encoding fix --- src/sh/notmuch.sh | 8 ++++++++ src/sh/preview.sh | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/sh/notmuch.sh b/src/sh/notmuch.sh index 942854f..1b46156 100644 --- a/src/sh/notmuch.sh +++ b/src/sh/notmuch.sh @@ -38,6 +38,14 @@ nm_message_get_part() { $NOTMUCH show --part="$2" id:"$1" } +# Print part of message, but this automatically converts to the current +# encoding. +# @argument $1: message id +# @argument $2: part number +nm_message_get_text_part() { + $NOTMUCH show --part="$2" --format=text id:"$1" | awk 'BEGIN { RS="\x0c"; FS="\n" } /^part{/ { for (i=2; i