From 83af570eae8668c9308050c1bb56b7bd10c0e4e7 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 25 May 1999 11:12:17 +0000 Subject: [PATCH] (smtpmail-send-it): Bind smtpmail-code-conv-from properly. (smtpmail-send-data-1): If DATA is a multibyte string, encode it by smtpmail-code-conv-from. --- lisp/mail/smtpmail.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 4778ded17bd..192235a2423 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -122,7 +122,11 @@ This is relative to `smtpmail-queue-dir'.") (tembuf (generate-new-buffer " smtpmail temp")) (case-fold-search nil) delimline - (mailbuf (current-buffer))) + (mailbuf (current-buffer)) + (smtpmail-code-conv-from + (if enable-multibyte-characters + (let ((sendmail-coding-system smtpmail-code-conv-from)) + (select-message-coding-system))))) (unwind-protect (save-excursion (set-buffer tembuf) @@ -564,8 +568,10 @@ This is relative to `smtpmail-queue-dir'.") (defun smtpmail-send-data-1 (process data) (goto-char (point-max)) - (when smtpmail-code-conv-from - (setq data (encode-coding-string data *internal* smtpmail-code-conv-from))) + (if (and (multibyte-string-p data) + smtpmail-code-conv-from) + (setq data (string-as-multibyte + (encode-coding-string data smtpmail-code-conv-from)))) (if smtpmail-debug-info (insert data "\r\n")) -- 2.39.5