From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Mysterious use of string-as-multibyte Date: Thu, 11 Jan 2018 11:04:39 -0500 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1515686624 14005 195.159.176.226 (11 Jan 2018 16:03:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 11 Jan 2018 16:03:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 11 17:03:39 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZfKM-00039R-AC for ged-emacs-devel@m.gmane.org; Thu, 11 Jan 2018 17:03:38 +0100 Original-Received: from localhost ([::1]:52678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZfMK-00068D-GL for ged-emacs-devel@m.gmane.org; Thu, 11 Jan 2018 11:05:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZfLS-0005yo-G2 for emacs-devel@gnu.org; Thu, 11 Jan 2018 11:04:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZfLN-0007jB-IY for emacs-devel@gnu.org; Thu, 11 Jan 2018 11:04:46 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:59787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZfLN-0007i9-E0 for emacs-devel@gnu.org; Thu, 11 Jan 2018 11:04:41 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0BG4drc022674; Thu, 11 Jan 2018 11:04:39 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 2BD856231F; Thu, 11 Jan 2018 11:04:39 -0500 (EST) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 3 Rules triggered BODY_START_GREETING=0.1, EDT_SA_DN_PASS=0, RV6198=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6198> : inlines <6305> : streams <1775760> : uri <2568088> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221838 Archived-At: Hi, Do you remember why you added the call to string-as-multibyte in the patch below? Stefan commit 83af570eae8668c9308050c1bb56b7bd10c0e4e7 Author: Kenichi Handa Date: Tue May 25 11:12:17 1999 +0000 (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. diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 4778ded17b..192235a242 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -122,7 +122,11 @@ smtpmail-send-it (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 @@ smtpmail-send-command (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"))