I am writing on a script that extracts and saves JPEG-attachements from emails and passes them to imagemagick. However, I am living in Germany and special characters in email text/subject as "ö", "ä", "ü" and "ß" are pretty common.
I am extracting the subject with formail:
SUBJECT=$(formail -zxSubject: <"$file")
and that results in:
- =?UTF-8?Q?Meine_G=c3=bcte?=
("Meine Güte") or even worse
- =?UTF-8?B?U2Now7ZuZSBHcsO8w59lIQ==?=
("Schöne Grüße!").
I try to use part of the subject as a filename and as imagemagick text annotation, which obviously doesn't work.
How do I convert this UTF-8 text to text with special characters in bash?
Thanks in advance! Markus