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#58507: Acknowledgement (Emacs does not preserve the coding system) Date: Thu, 09 Feb 2023 11:52:22 +0200 Message-ID: <83edqzmai1.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9912"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58507@debbugs.gnu.org To: Juhana Sadeharju Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 09 10:53:19 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 1pQ3cE-0002QX-VG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Feb 2023 10:53:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQ3c0-0005h2-16; Thu, 09 Feb 2023 04:53:04 -0500 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 1pQ3by-0005fT-Q3 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 04:53:02 -0500 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 1pQ3by-0001wD-Ee for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 04:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQ3by-00021x-53 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 04:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Feb 2023 09:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58507 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 58507-submit@debbugs.gnu.org id=B58507.16759363447754 (code B ref 58507); Thu, 09 Feb 2023 09:53:02 +0000 Original-Received: (at 58507) by debbugs.gnu.org; 9 Feb 2023 09:52:24 +0000 Original-Received: from localhost ([127.0.0.1]:57562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQ3bL-000210-QJ for submit@debbugs.gnu.org; Thu, 09 Feb 2023 04:52:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQ3bI-00020j-DP for 58507@debbugs.gnu.org; Thu, 09 Feb 2023 04:52:22 -0500 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 1pQ3bD-0001qj-2P; Thu, 09 Feb 2023 04:52:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=3zZyKuwrD460NUFp1CDRkdp55usrcjfox+lRx3PKtL0=; b=FG2QSwq7gXIxEG72iI0j nC5S+qAkSVoHFG5AVuKmF56PofNrSOtm8jBHlWv6Qs3nVpWClcStmhUhR8fbwq2MOUP/sNNfmuUBR 4KpE/g+pgKwO0smZPZ2oIeYurZ5X32dGvK2CFJIMhGouXUttX44d2M4N+OCIbW0Sr+8EwdDcSdUZ+ 5O1ndm725fvpj26tn2xsEYIJW1Z3GqgVedqQ38OGpoUEDL8tsNYrZ3JHJxnK97nXrSKIDHjBwvvBK A8TJBL6DUx0RrF4aVgLPIBGOJO+EcDgzWJfGEnn2zfcsF2I3po/ECp+Sv5chhRE2k3XUeY5/1eWkE f4VrhP/Z6LG5mw==; 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 1pQ3b0-0004Ft-LN; Thu, 09 Feb 2023 04:52:14 -0500 In-Reply-To: (message from Juhana Sadeharju on Thu, 9 Feb 2023 10:56:22 +0200) 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:255203 Archived-At: > From: Juhana Sadeharju > Date: Thu, 9 Feb 2023 10:56:22 +0200 > > Hello. Has this bug or feature been fixed? We made no change to Emacs due to this report, since I don't believe there's a bug here. This is how Emacs behaves, and this behavior is well documented and intended. In previous discussion of this issue, I pointed out how to deal with such situations; I repeat some of that below. > The problem is that Emacs doesn't keep the coding system I have > set (utf-8). The information about the file's encoding, if you want to keep it, should be in the file, using the 'coding:' cookie, by adding ";;; -*- coding: utf-8-dos; -*-" in the first line of the file. (You can also do this in the file's Local Variables section near the end of the file; see the "Specifying File Variables" node of the Emacs user manual for details. Alternatively, you can force Emacs to use UTF-8 when you visit the file: C-x RET c utf-8 RET C-x C-f RET The "C-x RET c utf-8 RET" prefix forces the following command to use UTF-8 for decoding and encoding text. > The file is opened with different coding system and all รครถ chars are a mess. Even I set the coding > system again to utf-8, all the mess remains. Fixing the mess does not help because the next time the coding > system is wrong again. > > Why Emacs doesn't let user to decide what is the coding system for the file? It does, see above. > I'm actually scared to use Emacs anymore because Emacs has converted thousands lines of text to a > mess because of this bug. As long as you only visit the file and don't make any changes to it, the "mess" on the screen is just a display problem; the file's contents is not changed. > There was a trick to fix the coding system by inserting commands to the start of file, so I suggest to add a > command like "fix the coding system to file" which adds the trick thing to the file. I keep forgetting the trick. The command is "C-x RET r". This re-reads the file after prompting you for the coding-system to decode the file's contents. Which is yet another alternative to "fix" the problem after you visit the file and notice the incorrect guess of its coding-system.