From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#28266: 25.2; RMAIL FCC coding issue Date: Sun, 24 Sep 2017 10:47:29 +0200 Message-ID: References: <83h8vudgfd.fsf@gnu.org> <83y3p6bioi.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1506242892 29495 195.159.176.226 (24 Sep 2017 08:48:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 24 Sep 2017 08:48:12 +0000 (UTC) Cc: 28266@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 24 10:48:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dw2a6-0007CS-Cf for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Sep 2017 10:48:06 +0200 Original-Received: from localhost ([::1]:37314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dw2aC-0001gf-Ab for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Sep 2017 04:48:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dw2a5-0001gL-QM for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2017 04:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dw2a2-000750-Mm for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2017 04:48:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46485) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dw2a2-00074q-Il for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2017 04:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dw2a2-0007qE-7F for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2017 04:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Sep 2017 08:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28266 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28266-submit@debbugs.gnu.org id=B28266.150624286530114 (code B ref 28266); Sun, 24 Sep 2017 08:48:02 +0000 Original-Received: (at 28266) by debbugs.gnu.org; 24 Sep 2017 08:47:45 +0000 Original-Received: from localhost ([127.0.0.1]:55165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dw2Zk-0007pe-PM for submit@debbugs.gnu.org; Sun, 24 Sep 2017 04:47:44 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:39219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dw2Zj-0007pP-GL for 28266@debbugs.gnu.org; Sun, 24 Sep 2017 04:47:44 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id E512F22553 for <28266@debbugs.gnu.org>; Sun, 24 Sep 2017 08:41:14 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1506242471; x=1507106472; bh=bSbZOzRb/L1eh nPzHbg6kXg63NMpC8mE0dGhPc2ZODo=; b=vTCDz5V1F9e7EspFB6IIIUkIIm3W7 YnWtoDD83P7zsHc9+a+CMFSW5YN1LV9QIywvN69/+UgJGxapJBZg7ci0GgbdbWfb Jc0tegpxgVE2hX7ugdjbEBOTogitV/jP5fB9micVk9Ypw8vZHNGuAvtMICAelfYg JK+s7Cnz7qEs7g= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8jxX4Xfq__er for <28266@debbugs.gnu.org>; Sun, 24 Sep 2017 08:41:11 +0000 (UTC) Original-Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 1015A22545; Sun, 24 Sep 2017 08:41:09 +0000 (UTC) In-reply-to: <83y3p6bioi.fsf@gnu.org> (message from Eli Zaretskii on Fri, 22 Sep 2017 23:08:13 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137326 Archived-At: > Date: Fri, 22 Sep 2017 23:08:13 +0300 > From: Eli Zaretskii > > > Date: Fri, 22 Sep 2017 20:39:45 +0200 > > From: charles@aurox.ch (Charles A. Roelli) > > CC: 28266@debbugs.gnu.org > > > > > Date: Fri, 22 Sep 2017 16:13:58 +0300 > > > From: Eli Zaretskii > > > > > > I cannot reproduce this with the current emacs-26 branch tip. > > > However, in my case, Emacs asked for a suitable coding-system each > > > time I wanted to send a message. Answering UTF-8 produced a valid > > > encoding in both cases. > > > > > > So perhaps the difference, and the reason for a problem you see, is > > > the default encoding in your case, which you didn't show. (In my > > > case, the default is Latin-1.) > > > > Hmm, I was never queried for a coding system. > > Because your default is UTF-8. This is normal. > > > I've repeated the issue on GNU/Linux with 25.3 and macOS with 25.3 > > and emacs-26. And I don't set any special locales/language > > environments: > > > > > Important settings: > > > value of $LANG: en_GB.UTF-8 > > > locale-coding-system: utf-8-unix > > With en_US.UTF-8 on GNU/Linux, using the current emacs-26 branch, I > see no problem: both messages are sent with a correct encoding. Yes, I believe that in my case too, the messages are (or would be) sent with the correct encoding. The encoding issue I mentioned seems to only apply to the saving of the mail buffer into the file specified in the FCC header. > What happens if you don't visit the FCC file after the first message > is sent, only after the second? Do you still see the second message > encoded incorrectly? No, in that case, both messages are encoded correctly. The encoding issue seems to only occur when the buffer is already open. The text of the outgoing mail buffer is inserted into the file specified by the FCC header using "insert-buffer-substring" in function "rmail-output-to-rmail-buffer" (use C-u C-M-x on this function before hitting C-c C-c y to resend the mail). If you switch to "tembuf" (argument to "rmail-output-to-rmail-buffer") in another frame while debugging this function, you can see in the modeline that its coding system is utf-8-unix. Then if you switch to the buffer containing the FCC file, the modeline indicates that it's unibyte. Note also that variable "enable-multibyte-characters" is bound to nil around this call.