From unknown Sun Sep 07 16:50:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79316: End-of-line problems with text files inside zip files Resent-From: "R. Diez" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Aug 2025 07:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 79316 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79316@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175619342612709 (code B ref -1); Tue, 26 Aug 2025 07:31:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Aug 2025 07:30:26 +0000 Received: from localhost ([127.0.0.1]:53805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uqo8Q-0003It-9x for submit@debbugs.gnu.org; Tue, 26 Aug 2025 03:30:26 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37774) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uqo8I-0003Dc-Fj for submit@debbugs.gnu.org; Tue, 26 Aug 2025 03:30:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uqo89-0001aw-RF for bug-gnu-emacs@gnu.org; Tue, 26 Aug 2025 03:30:10 -0400 Received: from relay.yourmailgateway.de ([188.68.61.103]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uqo83-0004ty-Hx for bug-gnu-emacs@gnu.org; Tue, 26 Aug 2025 03:30:09 -0400 Received: from mors-relay-8403.netcup.net (localhost [127.0.0.1]) by mors-relay-8403.netcup.net (Postfix) with ESMTPS id 4c9znw0zVHz85V7 for ; Tue, 26 Aug 2025 09:29:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rd10.de; s=key2; t=1756193396; bh=YyUAn4qBDzs6x3dWYQ0iNIXzLwXo9RTTrMf5NMR7FTI=; h=Date:To:From:Subject:From; b=L1ZZfyPGbynH7WwGgrN2eBipl93T9nrPuVy5LJ6awv+IkPlLhL1hd3ePsdBQEaEYV SwDwKPHJo7vUQswdjWRzfSBqaEoZVdbVpcwt3vntV5uhgC0+zO+0/AwrWI6kyJdU0R Dk8iX2OjG5Td3gIXJHsJUvSGw5olYuq+XpdFtWiorjqVuoCe2GoI9eY5RB9xk2ASew nudRy3N02q7Bd5Q394d/WNLCnav6hJeEsNFXCm9VoVb5nsjknU4Rd13pRCbqKjmK6X BWvfIaza1UBhG3yH7lB2s3pkRdawJCz3b+XggaGKu4K+9FYWZld9Pji9GXElK/ebmW ldOrUbR4xN89g== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8403.netcup.net (Postfix) with ESMTPS id 4c9znw0bmVz85S2 for ; Tue, 26 Aug 2025 09:29:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.901 X-Spam-Level: X-Spam-Status: No, score=-2.901 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from mx2eb1.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4c9znv4cSXz8sfv for ; Tue, 26 Aug 2025 09:29:55 +0200 (CEST) Received: from [IPV6:2003:cf:cf29:c500:666c:8da4:64b8:ec83] (p200300cfcf29c500666c8da464b8ec83.dip0.t-ipconnect.de [IPv6:2003:cf:cf29:c500:666c:8da4:64b8:ec83]) by mx2eb1.netcup.net (Postfix) with ESMTPSA id EBBE3100150 for ; Tue, 26 Aug 2025 09:29:50 +0200 (CEST) Authentication-Results: mx2eb1; spf=pass (sender IP is 2003:cf:cf29:c500:666c:8da4:64b8:ec83) smtp.mailfrom=rdiez-2006@rd10.de smtp.helo=[IPV6:2003:cf:cf29:c500:666c:8da4:64b8:ec83] Received-SPF: pass (mx2eb1: connection is authenticated) Content-Type: multipart/mixed; boundary="------------bw2j6typtoIr7u9eF0sGC7MP" Message-ID: <14438521-7c7f-4675-9fe6-fe08044a62bb@rd10.de> Date: Tue, 26 Aug 2025 09:29:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "R. Diez" Content-Language: en-GB X-PPP-Message-ID: <175619339113.991322.1792762476061938245@mx2eb1.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: EBBE3100150 X-NC-CID: mwVCKTpHrLGrzFHyqz5FzJgY+1cuO/ceNEnsxpOC Received-SPF: pass client-ip=188.68.61.103; envelope-from=rdiez-2006@rd10.de; helo=relay.yourmailgateway.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) This is a multi-part message in MIME format. --------------bw2j6typtoIr7u9eF0sGC7MP Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi all: I am using Emacs 29, and I have built Emacs myself on Ubuntu 22.04. But I have had this issue with older Emacs and Ubuntu versions too. I have attached a zip file with 3 text files: test1.txt - with encoding utf-8-with-signature-dos test2.xml - with encoding utf-8-dos test3.xml - with encoding utf-8-dos too If if unpack the zip file in the shell and open those files with Emacs, everything is fine. However, if you open the zip file with Emacs, and then open those text files inside, there are end-of-line problems: test1.txt shows encoding utf-8-with-signature-unix. That is, it loses the DOS CR LF line terminators. test2.xml has a similar problem. The encoding is then shown as utf-8-unix. test3.xml has the same problem, but each line shows a ^M marker at the end. The only difference between test2.xml and test3.xml is that the latter starts with this line: This problem is probably known, but I could not find a description or a workaround on the Internet. Or maybe I did not come up with the right search keywords. Regards, rdiez --------------bw2j6typtoIr7u9eF0sGC7MP Content-Type: application/zip; name="test.zip" Content-Disposition: attachment; filename="test.zip" Content-Transfer-Encoding: base64 UEsDBBQAAAAIAG9CGlvw9LakEgAAABMAAAAJABwAdGVzdDEudHh0VVQJAAPxUa1o8VGtaHV4 CwABBOgDAAAE6AMAAHu/e79PZl6qgiEvF5g24uUCAFBLAwQUAAAACABSRRpbfWl+hQ4AAAAT AAAACQAcAHRlc3QyLnhtbFVUCQADXFetaFxXrWh1eAsAAQToAwAABOgDAACzKUktLjGy4+Wy 0YexAFBLAwQUAAAACABYRRpbapm+uTQAAAA7AAAACQAcAHRlc3QzLnhtbFVUCQADaFetaGhX rWh1eAsAAQToAwAABOgDAACzsa/IzVEoSy0qzszPs1Uy1DNQUkjNS85PycxLt1UKDXHTtVCy t+PlsilJLS4xBjH0YSwAUEsBAh4DFAAAAAgAb0IaW/D0tqQSAAAAEwAAAAkAGAAAAAAAAQAA ALSBAAAAAHRlc3QxLnR4dFVUBQAD8VGtaHV4CwABBOgDAAAE6AMAAFBLAQIeAxQAAAAIAFJF Glt9aX6FDgAAABMAAAAJABgAAAAAAAEAAAC0gVUAAAB0ZXN0Mi54bWxVVAUAA1xXrWh1eAsA AQToAwAABOgDAABQSwECHgMUAAAACABYRRpbapm+uTQAAAA7AAAACQAYAAAAAAABAAAAtIGm AAAAdGVzdDMueG1sVVQFAANoV61odXgLAAEE6AMAAAToAwAAUEsFBgAAAAADAAMA7QAAAB0B AAAAAA== --------------bw2j6typtoIr7u9eF0sGC7MP-- From unknown Sun Sep 07 16:50:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79316: End-of-line problems with text files inside zip files Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Aug 2025 12:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79316 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "R. Diez" Cc: 79316@debbugs.gnu.org Received: via spool by 79316-submit@debbugs.gnu.org id=B79316.175638395614893 (code B ref 79316); Thu, 28 Aug 2025 12:26:02 +0000 Received: (at 79316) by debbugs.gnu.org; 28 Aug 2025 12:25:56 +0000 Received: from localhost ([127.0.0.1]:38752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1urbhT-0003s9-E3 for submit@debbugs.gnu.org; Thu, 28 Aug 2025 08:25:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40524) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1urbhQ-0003rw-Sq for 79316@debbugs.gnu.org; Thu, 28 Aug 2025 08:25:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1urbhJ-0002k5-P1; Thu, 28 Aug 2025 08:25:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ksqpcoqEG0bn+EjPHoJhCdo5FMlmxqnvrSUFmh98lG0=; b=ruG/H7SYZjyk RhnehsEOoI+zfKH0KzHMwL+RuIfCFk2V8vDlJ7xdkaQ8WbdL58HCGd0MWeypDSsrtEMhXTDI22f3Z 0VtZR4mhi42t3WoA8nYRyHBrNgVafEd0mLYKN7gW1rx1iKLjZrszqPX/1DOAgIEhwyxlnXGzsBTNi QHuktB16rcyNwK/D7kl13TRxIEaSzrqLJ4qBuXdeVkeNAj0ki9d5hQtyxYLVxJjsjqtpay7FGHksX MM5+R9+qZN+Wr1fDfZ+xuNXxz7RKaMPKitIHZ/2U0NLM9B5xaUru1Kaq/BmXxWNEXlhlrWPYBLMjf p4uacgzTZsyQKKXtIzPtCA==; Date: Thu, 28 Aug 2025 15:25:42 +0300 Message-Id: <86sehbske1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <14438521-7c7f-4675-9fe6-fe08044a62bb@rd10.de> (bug-gnu-emacs@gnu.org) References: <14438521-7c7f-4675-9fe6-fe08044a62bb@rd10.de> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 26 Aug 2025 09:29:48 +0200 > From: "R. Diez" via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I am using Emacs 29, and I have built Emacs myself on Ubuntu 22.04. But I have had this issue with older Emacs and Ubuntu versions too. > > I have attached a zip file with 3 text files: > > test1.txt - with encoding utf-8-with-signature-dos > test2.xml - with encoding utf-8-dos > test3.xml - with encoding utf-8-dos too > > If if unpack the zip file in the shell and open those files with Emacs, everything is fine. > > However, if you open the zip file with Emacs, and then open those text files inside, there are end-of-line problems: > > test1.txt shows encoding utf-8-with-signature-unix. That is, it loses the DOS CR LF line terminators. > > test2.xml has a similar problem. The encoding is then shown as utf-8-unix. > > test3.xml has the same problem, but each line shows a ^M marker at the end. The only difference between test2.xml and test3.xml is that the latter starts with this line: > > > > This problem is probably known, but I could not find a description or a workaround on the Internet. Or maybe I did not come up with the right search keywords. Thanks for an easy-to-use test case. The root cause here was that we were losing information about the EOL type of the file determined when we decode it after extraction from the archive. And the reason why this went unnoticed (at least AFAIK) is probably that the problem rears its ugly head only when the EOL type of the file is NOT the default EOL type of the platform (DOS on Unix, Unix on DOS/Windows, etc.), which probably happens rather rarely. Long story short, please try the patch below, and see if it gives good results without introducing any new problems. diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 8f6c71a..fbfd7cc 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -1067,8 +1067,18 @@ archive-set-buffer-as-visiting-file (setq coding (coding-system-change-text-conversion coding 'raw-text))) (unless (memq coding '(nil no-conversion)) + ;; If CODING specifies a certain EOL conversion, reset that, to + ;; force 'decode-coding-region' below determine EOL conversion + ;; from the file's data... + (if (numberp (coding-system-eol-type coding)) + (setq coding (coding-system-change-eol-conversion coding nil))) (decode-coding-region (point-min) (point-max) coding) - (setq last-coding-system-used coding)) + ;; ...then augment CODING with the actual EOL conversion + ;; determined from the file's data. + (setq last-coding-system-used + (coding-system-change-eol-conversion + coding + (coding-system-eol-type last-coding-system-used)))) (set-buffer-modified-p nil) (kill-local-variable 'buffer-file-coding-system) (after-insert-file-set-coding (- (point-max) (point-min)))))) From unknown Sun Sep 07 16:50:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79316: End-of-line problems with text files inside zip files Resent-From: "R. Diez" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Aug 2025 16:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79316 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 79316@debbugs.gnu.org Received: via spool by 79316-submit@debbugs.gnu.org id=B79316.175657146511221 (code B ref 79316); Sat, 30 Aug 2025 16:32:02 +0000 Received: (at 79316) by debbugs.gnu.org; 30 Aug 2025 16:31:05 +0000 Received: from localhost ([127.0.0.1]:49453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usOTo-0002us-WD for submit@debbugs.gnu.org; Sat, 30 Aug 2025 12:31:05 -0400 Received: from relay.yourmailgateway.de ([188.68.63.166]:54659) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usOTh-0002u1-25 for 79316@debbugs.gnu.org; Sat, 30 Aug 2025 12:31:00 -0400 Received: from mors-relay-8202.netcup.net (localhost [127.0.0.1]) by mors-relay-8202.netcup.net (Postfix) with ESMTPS id 4cDgcG55j2z3x61; Sat, 30 Aug 2025 18:30:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rd10.de; s=key2; t=1756571454; bh=P4YuUd2JemfIHyatU5A8yQnalXMT6Xz9DJ8LZW1Eifw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SIjnigenQ9pMB/sArgubwbMGeaIpPgwuEiZ3suqpCuIIphh1k4NAwcye03eiaNXfY BNxRxV71sh7gaJ6Vi2dd5O1J7KkdSZEjVi/FS/I3OWC8S5bqGwnGgl3Pz6HrAB9QXj Olq9fICG8yHbrQlySIiBCwKaj++1pEBTfaLm5uhDxOetKcziytz80XMuxncsunPz2S gu98QKXO2LL/SBxzmTr1qwIZtnBkqpuL4ucQsLCk+3v81eCcH/bexUPzJtbk7TVQ08 /5RPxfWVuphjSElFUBOr2a24CG8TgK0VS3Y1JiodN1fRalI+trlJg9MV/4RlWsmLEa xA7KSkmgYMqEQ== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8202.netcup.net (Postfix) with ESMTPS id 4cDgcG4P72z3x5L; Sat, 30 Aug 2025 18:30:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.901 X-Spam-Level: X-Spam-Status: No, score=-2.901 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from mx2eb1.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4cDgcG1L3Dz8scC; Sat, 30 Aug 2025 18:30:53 +0200 (CEST) Received: from [IPV6:2a02:3102:8e00:2060:b319:cbbc:c8bb:892b] (dynamic-2a02-3102-8e00-2060-b319-cbbc-c8bb-892b.310.pool.telefonica.de [IPv6:2a02:3102:8e00:2060:b319:cbbc:c8bb:892b]) by mx2eb1.netcup.net (Postfix) with ESMTPSA id 8B3D51005D5; Sat, 30 Aug 2025 18:30:48 +0200 (CEST) Authentication-Results: mx2eb1; spf=pass (sender IP is 2a02:3102:8e00:2060:b319:cbbc:c8bb:892b) smtp.mailfrom=rdiez-2006@rd10.de smtp.helo=[IPV6:2a02:3102:8e00:2060:b319:cbbc:c8bb:892b] Received-SPF: pass (mx2eb1: connection is authenticated) Message-ID: Date: Sat, 30 Aug 2025 18:30:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <14438521-7c7f-4675-9fe6-fe08044a62bb@rd10.de> <86sehbske1.fsf@gnu.org> From: "R. Diez" Content-Language: en-GB In-Reply-To: <86sehbske1.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PPP-Message-ID: <175657144873.3763252.11179180808200866168@mx2eb1.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: 8B3D51005D5 X-NC-CID: hpSL/J7geXRnBHhdHK2jliVCGyWQFmwI/BYxvIl4 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > [...] > Long story short, please try the patch below, and see if it gives good > results without introducing any new problems. I had some difficulty with the patch. It seems to be for Git, but I haven't built Emacs from Git, and tool 'patch' could not find the file. But after some manual twiddling, it applied fine on my Emacs 29. I then opened the usual .zip with .xml files inside that always gave me trouble, and this time it worked fine. Thanks, rdiez From unknown Sun Sep 07 16:50:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "R. Diez" Subject: bug#79316: closed (Re: bug#79316: End-of-line problems with text files inside zip files) Message-ID: References: <86h5xopx18.fsf@gnu.org> <14438521-7c7f-4675-9fe6-fe08044a62bb@rd10.de> X-Gnu-PR-Message: they-closed 79316 X-Gnu-PR-Package: emacs Reply-To: 79316@debbugs.gnu.org Date: Sat, 30 Aug 2025 16:59:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1756573143-17323-1" This is a multi-part message in MIME format... ------------=_1756573143-17323-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #79316: End-of-line problems with text files inside zip files which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 79316@debbugs.gnu.org. --=20 79316: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D79316 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1756573143-17323-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 79316-done) by debbugs.gnu.org; 30 Aug 2025 16:58:09 +0000 Received: from localhost ([127.0.0.1]:49624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usOu0-0004T4-8H for submit@debbugs.gnu.org; Sat, 30 Aug 2025 12:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47020) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usOtn-0004S5-MC for 79316-done@debbugs.gnu.org; Sat, 30 Aug 2025 12:57:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1usOtg-0005kf-QL; Sat, 30 Aug 2025 12:57:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WgprPenQMJ1f0uzXdCrktJVR+fvP7Xp42xRKltJd7WQ=; b=IL7bFro+BELH 584cAovYq+l8LoYbKIuGpu0aaHbKOOkcH8c3sKPitKFb8BqZm9jlEPNTsUclB+6yStyo9+D0CBA/G PFdUNAZPKJPBhL1FfLz0SjSnkur2ZNrn+yA/0rPHv0AQ0jr7qtA+iKvf/dPuzCM1RJYUQ3+UC3Rlk 1BB4IfDrme4UL1nPh76/bQgMAjyFsJMBKxguQWqb426HNCTkhQefkd35BfNAK5ds+oEDx3GR56hxU 8IM5n1Tv6+pqi2XNhioneL0qlJWfyVCnz3Bm+BRTFQzYZwb//t4MpMfWOUo19udNU4lNPz3a/aogY BwRj6753ZQYHVr7piUTvag==; Date: Sat, 30 Aug 2025 19:57:39 +0300 Message-Id: <86h5xopx18.fsf@gnu.org> From: Eli Zaretskii To: "R. Diez" In-Reply-To: (rdiez-2006@rd10.de) Subject: Re: bug#79316: End-of-line problems with text files inside zip files References: <14438521-7c7f-4675-9fe6-fe08044a62bb@rd10.de> <86sehbske1.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79316-done Cc: 79316-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 30 Aug 2025 18:30:48 +0200 > Cc: 79316@debbugs.gnu.org > From: "R. Diez" > > > [...] > > Long story short, please try the patch below, and see if it gives good > > results without introducing any new problems. > > I had some difficulty with the patch. It seems to be for Git, but I haven't built Emacs from Git, and tool 'patch' could not find the file. Thanks. For the future, you can apply patches meant for Git using the 'patch' utility if you pass the -pN switch to 'patch', where N is the number of slashes to remove from the file names mentioned in the patch. So, for example, if the patch says diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 8f6c71a..fbfd7cc 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el and the unpatched arc-mode.el lives in the directory /foo/bar/lisp, you can invoke 'patch' like this: $ patch -d /foo/bar/lisp -p2 < PATCH-FILE since removing 2 slashes from a/lisp/arc-mode.el leaves you with just arc-mode.el, which makes it the correct file name relative to the directory /foo/bar/lisp given as argument to the -d switch. > But after some manual twiddling, it applied fine on my Emacs 29. I then opened the usual .zip with .xml files inside that always gave me trouble, and this time it worked fine. Thanks for testing, I've now installed the fix (with some additional tweaking, per some more thorough testing) on the master branch, and I'm therefore closing this bug. ------------=_1756573143-17323-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Aug 2025 07:30:26 +0000 Received: from localhost ([127.0.0.1]:53805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uqo8Q-0003It-9x for submit@debbugs.gnu.org; Tue, 26 Aug 2025 03:30:26 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37774) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uqo8I-0003Dc-Fj for submit@debbugs.gnu.org; Tue, 26 Aug 2025 03:30:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uqo89-0001aw-RF for bug-gnu-emacs@gnu.org; Tue, 26 Aug 2025 03:30:10 -0400 Received: from relay.yourmailgateway.de ([188.68.61.103]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uqo83-0004ty-Hx for bug-gnu-emacs@gnu.org; Tue, 26 Aug 2025 03:30:09 -0400 Received: from mors-relay-8403.netcup.net (localhost [127.0.0.1]) by mors-relay-8403.netcup.net (Postfix) with ESMTPS id 4c9znw0zVHz85V7 for ; Tue, 26 Aug 2025 09:29:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rd10.de; s=key2; t=1756193396; bh=YyUAn4qBDzs6x3dWYQ0iNIXzLwXo9RTTrMf5NMR7FTI=; h=Date:To:From:Subject:From; b=L1ZZfyPGbynH7WwGgrN2eBipl93T9nrPuVy5LJ6awv+IkPlLhL1hd3ePsdBQEaEYV SwDwKPHJo7vUQswdjWRzfSBqaEoZVdbVpcwt3vntV5uhgC0+zO+0/AwrWI6kyJdU0R Dk8iX2OjG5Td3gIXJHsJUvSGw5olYuq+XpdFtWiorjqVuoCe2GoI9eY5RB9xk2ASew nudRy3N02q7Bd5Q394d/WNLCnav6hJeEsNFXCm9VoVb5nsjknU4Rd13pRCbqKjmK6X BWvfIaza1UBhG3yH7lB2s3pkRdawJCz3b+XggaGKu4K+9FYWZld9Pji9GXElK/ebmW ldOrUbR4xN89g== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8403.netcup.net (Postfix) with ESMTPS id 4c9znw0bmVz85S2 for ; Tue, 26 Aug 2025 09:29:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.901 X-Spam-Level: X-Spam-Status: No, score=-2.901 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from mx2eb1.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4c9znv4cSXz8sfv for ; Tue, 26 Aug 2025 09:29:55 +0200 (CEST) Received: from [IPV6:2003:cf:cf29:c500:666c:8da4:64b8:ec83] (p200300cfcf29c500666c8da464b8ec83.dip0.t-ipconnect.de [IPv6:2003:cf:cf29:c500:666c:8da4:64b8:ec83]) by mx2eb1.netcup.net (Postfix) with ESMTPSA id EBBE3100150 for ; Tue, 26 Aug 2025 09:29:50 +0200 (CEST) Authentication-Results: mx2eb1; spf=pass (sender IP is 2003:cf:cf29:c500:666c:8da4:64b8:ec83) smtp.mailfrom=rdiez-2006@rd10.de smtp.helo=[IPV6:2003:cf:cf29:c500:666c:8da4:64b8:ec83] Received-SPF: pass (mx2eb1: connection is authenticated) Content-Type: multipart/mixed; boundary="------------bw2j6typtoIr7u9eF0sGC7MP" Message-ID: <14438521-7c7f-4675-9fe6-fe08044a62bb@rd10.de> Date: Tue, 26 Aug 2025 09:29:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: bug-gnu-emacs@gnu.org From: "R. Diez" Content-Language: en-GB Subject: End-of-line problems with text files inside zip files X-PPP-Message-ID: <175619339113.991322.1792762476061938245@mx2eb1.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: EBBE3100150 X-NC-CID: mwVCKTpHrLGrzFHyqz5FzJgY+1cuO/ceNEnsxpOC Received-SPF: pass client-ip=188.68.61.103; envelope-from=rdiez-2006@rd10.de; helo=relay.yourmailgateway.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) This is a multi-part message in MIME format. --------------bw2j6typtoIr7u9eF0sGC7MP Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi all: I am using Emacs 29, and I have built Emacs myself on Ubuntu 22.04. But I have had this issue with older Emacs and Ubuntu versions too. I have attached a zip file with 3 text files: test1.txt - with encoding utf-8-with-signature-dos test2.xml - with encoding utf-8-dos test3.xml - with encoding utf-8-dos too If if unpack the zip file in the shell and open those files with Emacs, everything is fine. However, if you open the zip file with Emacs, and then open those text files inside, there are end-of-line problems: test1.txt shows encoding utf-8-with-signature-unix. That is, it loses the DOS CR LF line terminators. test2.xml has a similar problem. The encoding is then shown as utf-8-unix. test3.xml has the same problem, but each line shows a ^M marker at the end. The only difference between test2.xml and test3.xml is that the latter starts with this line: This problem is probably known, but I could not find a description or a workaround on the Internet. Or maybe I did not come up with the right search keywords. Regards, rdiez --------------bw2j6typtoIr7u9eF0sGC7MP Content-Type: application/zip; name="test.zip" Content-Disposition: attachment; filename="test.zip" Content-Transfer-Encoding: base64 UEsDBBQAAAAIAG9CGlvw9LakEgAAABMAAAAJABwAdGVzdDEudHh0VVQJAAPxUa1o8VGtaHV4 CwABBOgDAAAE6AMAAHu/e79PZl6qgiEvF5g24uUCAFBLAwQUAAAACABSRRpbfWl+hQ4AAAAT AAAACQAcAHRlc3QyLnhtbFVUCQADXFetaFxXrWh1eAsAAQToAwAABOgDAACzKUktLjGy4+Wy 0YexAFBLAwQUAAAACABYRRpbapm+uTQAAAA7AAAACQAcAHRlc3QzLnhtbFVUCQADaFetaGhX rWh1eAsAAQToAwAABOgDAACzsa/IzVEoSy0qzszPs1Uy1DNQUkjNS85PycxLt1UKDXHTtVCy t+PlsilJLS4xBjH0YSwAUEsBAh4DFAAAAAgAb0IaW/D0tqQSAAAAEwAAAAkAGAAAAAAAAQAA ALSBAAAAAHRlc3QxLnR4dFVUBQAD8VGtaHV4CwABBOgDAAAE6AMAAFBLAQIeAxQAAAAIAFJF Glt9aX6FDgAAABMAAAAJABgAAAAAAAEAAAC0gVUAAAB0ZXN0Mi54bWxVVAUAA1xXrWh1eAsA AQToAwAABOgDAABQSwECHgMUAAAACABYRRpbapm+uTQAAAA7AAAACQAYAAAAAAABAAAAtIGm AAAAdGVzdDMueG1sVVQFAANoV61odXgLAAEE6AMAAAToAwAAUEsFBgAAAAADAAMA7QAAAB0B AAAAAA== --------------bw2j6typtoIr7u9eF0sGC7MP-- ------------=_1756573143-17323-1-- From unknown Sun Sep 07 16:50:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79316: End-of-line problems with text files inside zip files Resent-From: "R. Diez" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Aug 2025 17:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79316 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 79316-done@debbugs.gnu.org Received: via spool by 79316-done@debbugs.gnu.org id=D79316.175657317617437 (code D ref 79316); Sat, 30 Aug 2025 17:00:03 +0000 Received: (at 79316-done) by debbugs.gnu.org; 30 Aug 2025 16:59:36 +0000 Received: from localhost ([127.0.0.1]:49635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usOvP-0004X9-CK for submit@debbugs.gnu.org; Sat, 30 Aug 2025 12:59:35 -0400 Received: from relay.yourmailgateway.de ([188.68.63.162]:47525) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usOvM-0004Ws-3W for 79316-done@debbugs.gnu.org; Sat, 30 Aug 2025 12:59:33 -0400 Received: from mors-relay-8201.netcup.net (localhost [127.0.0.1]) by mors-relay-8201.netcup.net (Postfix) with ESMTPS id 4cDhFG0kskz3wH2; Sat, 30 Aug 2025 18:59:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rd10.de; s=key2; t=1756573170; bh=09bILXOWC8jUDnn0ujpjHluR+XTvJU+wgE4F7SsK0Z4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=XWnL9xr8booPJmGg2+2pDri9n5g6jSkU9W5ClytC0bQo1GAP2nEcQ0Cy6GAArTWC8 /Heeh86ovupqUtHEQ3LxqdC/l9nE4xUdk0gvu0GEmgRVJpIiWR+5227+NiLkn4sUGA FwpMA3CQJOgIJxAW9GMW9hXLC+TpvdcdAqGlV+KjRawgIlmh+wENJYjuj0Fdylo9AL /VJWt/Bw2CwVr80dAurjfmCWkEq+XnoerCyApCCeFSdj2yRTymdwQERcabB4Y4Qco1 kcWjC0ogs//S6TXmSAkxTCiCxQbKfkUhg//rbutCL9d5dC5HE57drlL1BpXqDTNtuI cHCjO7qeJkZUg== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8201.netcup.net (Postfix) with ESMTPS id 4cDhFG01HMz3wGl; Sat, 30 Aug 2025 18:59:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.901 X-Spam-Level: X-Spam-Status: No, score=-2.901 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from mx2eb1.netcup.net (unknown [10.243.12.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4cDhFF2SjPz8scC; Sat, 30 Aug 2025 18:59:29 +0200 (CEST) Received: from [IPV6:2a02:3102:8e00:2060:b319:cbbc:c8bb:892b] (dynamic-2a02-3102-8e00-2060-b319-cbbc-c8bb-892b.310.pool.telefonica.de [IPv6:2a02:3102:8e00:2060:b319:cbbc:c8bb:892b]) by mx2eb1.netcup.net (Postfix) with ESMTPSA id A1DA3100153; Sat, 30 Aug 2025 18:59:28 +0200 (CEST) Authentication-Results: mx2eb1; spf=pass (sender IP is 2a02:3102:8e00:2060:b319:cbbc:c8bb:892b) smtp.mailfrom=rdiez-2006@rd10.de smtp.helo=[IPV6:2a02:3102:8e00:2060:b319:cbbc:c8bb:892b] Received-SPF: pass (mx2eb1: connection is authenticated) Message-ID: Date: Sat, 30 Aug 2025 18:59:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <14438521-7c7f-4675-9fe6-fe08044a62bb@rd10.de> <86sehbske1.fsf@gnu.org> <86h5xopx18.fsf@gnu.org> From: "R. Diez" Content-Language: en-GB In-Reply-To: <86h5xopx18.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PPP-Message-ID: <175657316883.3957206.3921810065386206354@mx2eb1.netcup.net> X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: A1DA3100153 X-NC-CID: R803K3LOOJiYy1NdN1Sekk858c3zYneMKyFKKANj X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > [...] > I've now installed the fix (with some additional > tweaking, per some more thorough testing) on the master branch, and > I'm therefore closing this bug. Great, thanks!