This Emacs Lisp function is supposed to give me RFC 2047 by using
external command:

(defun rcd-mailutils-flt2047 (string &optional encoding q-or-b)
  (let*  ((encoding (or encoding "utf-8"))
          (q-or-b (or "Q" q-or-b))
          (command (format "mailutils flt2047 -c %s -E%s \"%s\"" encoding 
q-or-b string))
          (result (string-trim (shell-command-to-string command))))
    result))

And I get this:

(rcd-mailutils-flt2047 "Č <bugs@gnu.support>")
"=?utf-8?Q?=C4=8C_<bugs@gnu.support>?="

And then mail complains that email address is not valid.

If I use the built in Emacs function then I get different result:

(rfc2047-encode-string "Č <bugs@gnu.support>")
"=?utf-8?Q?=C4=8C?= <bugs@gnu.support>"

Another question is if `mailutils flt2047' really needs to encode
something what need not be encoded, as this below is also not encoding it:

(rfc2047-encode-string "ABC <bugs@gnu.support>")
"ABC <bugs@gnu.support>"

while this is encoding:

(rfc2047-encode-string "ABČ <bugs@gnu.support>")
"=?utf-8?Q?AB=C4=8C?= <bugs@gnu.support>"

while this is also encoding which is probably not necessary and probably 
incorrect.

(rcd-mailutils-flt2047 "ABC <bugs@gnu.support>")
"=?utf-8?Q?ABC_<bugs@gnu.support>?="

Maybe the function from mailutils asks me to parse and separate
name from the email address. It is just hypothetical question on
how it should be.

-- 
Thanks,
Jean Louis
⎔ λ 🄯 𝍄 𝌡 𝌚

Reply via email to