From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64253: 26.3; Bug in revert-buffer-with-coding-system Date: Sat, 24 Jun 2023 11:51:39 +0300 Message-ID: <83sfahz1ic.fsf@gnu.org> References: <20230623.124319.782140973726874654.mail@localhost.localdomain> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24875"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64253@debbugs.gnu.org To: meta1729 Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 24 10:52:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qCz0H-000658-6W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Jun 2023 10:52:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCyzz-0004VZ-PD; Sat, 24 Jun 2023 04:52:03 -0400 Original-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 1qCyzy-0004UZ-7p for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 04:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCyzx-0006VY-OI for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 04:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qCyzx-0006V8-Ko for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 04:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Jun 2023 08:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64253 X-GNU-PR-Package: emacs Original-Received: via spool by 64253-submit@debbugs.gnu.org id=B64253.168759669424951 (code B ref 64253); Sat, 24 Jun 2023 08:52:01 +0000 Original-Received: (at 64253) by debbugs.gnu.org; 24 Jun 2023 08:51:34 +0000 Original-Received: from localhost ([127.0.0.1]:39912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCyzV-0006UL-To for submit@debbugs.gnu.org; Sat, 24 Jun 2023 04:51:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCyzS-0006U6-Jr for 64253@debbugs.gnu.org; Sat, 24 Jun 2023 04:51:32 -0400 Original-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 1qCyzN-0006OI-3Y; Sat, 24 Jun 2023 04:51:25 -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=DBUcuUnn3i4yxxnW4bsM1uYfmKnxbovPW8KZlgHWY0E=; b=Wrr2Mx9o1tat s1qYEfMNUeBSfVbMZTbfuieEj9FSJdZLuiZICQlzjt8gjGPtC6BWmbJ3B3wHoEiSD4WVueqZkIQzW Wfv08CTi8PTckRHt7RKFdGyF3G9DRrwMQEeQ+sK7xgwOQmRjE1uJAO4lVpKhkG94MXyLtfGnaM2Xr RAINZljhiKdwDYnxPEZtAh0vzot4EQI7586xI83fg6pG9LGVwyKhg77rLmeUMooOYYJNC3w+OQDUO SMIS4p0yPgS5xCHOijQ+npwbzjaBBzWvvFzgsZokea+LcovXG7rz1DRfjmUUzXItf/aWFamoS3a/7 UCB+940LDaqMQ1bO6dlIHQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCyzM-0000of-KB; Sat, 24 Jun 2023 04:51:24 -0400 In-Reply-To: <20230623.124319.782140973726874654.mail@localhost.localdomain> (message from meta1729 on Fri, 23 Jun 2023 12:43:19 +0530 (IST)) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263978 Archived-At: > Cc: meta1729 > Date: Fri, 23 Jun 2023 12:43:19 +0530 (IST) > From: meta1729 > > > When a buffer is terminated with an un-encodable character, > revert-buffer-with-coding-system modifies the buffer in unexpected > ways when coding system of the buffer is changed from default > iso-latin-1-unix to utf-8-unix, when the visited file contains > characters that cannot be encoded in either iso-latin-1-unix or > utf-8-unix. > > Procedure to reproduce the bug. > > [Create a file which has un-encodable characters and some text between them.] > $ echo 3b3b20410a3b3b20420aa80a3b3b20430a3b3b20440aa9 | xxd -r -p > sample > > Open in Emacs. > $ emacs -q -nw --no-site-file -nsl sample > > Enter: C-h C [describe-coding-system] > Output: > Coding system for saving this buffer: > 1 -- iso-latin-1-unix (alias: iso-8859-1-unix latin-1-unix) > > Enter: M-x revert-buffer-with-coding-system RET utf-8 RET yes > > [The buffer has been incorrectly modified. You can see escaped > character code at the beginning of buffer, which previously existed at > the end of the buffer.] Thanks. This 21-year old bug (a simple omission of a single code line) should now be fixed on the emacs-29 branch.