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: Emacs does not preserve the coding system Date: Mon, 24 Oct 2022 15:45:07 +0300 Message-ID: <83a65lqtkc.fsf@gnu.org> References: <83o7ue8z5f.fsf@gnu.org> 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="17178"; 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 Mon Oct 24 14:50:07 2022 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 1omwu5-0004Ci-P7 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Oct 2022 14:50:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omwqF-00065D-CR; Mon, 24 Oct 2022 08:46:07 -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 1omwqB-00063b-7n for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 08:46:04 -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 1omwqB-0003zT-0T for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 08:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omwqA-0005XF-JT for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 08:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Oct 2022 12:46: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.166661554021238 (code B ref 58507); Mon, 24 Oct 2022 12:46:02 +0000 Original-Received: (at 58507) by debbugs.gnu.org; 24 Oct 2022 12:45:40 +0000 Original-Received: from localhost ([127.0.0.1]:47346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omwpo-0005WT-IG for submit@debbugs.gnu.org; Mon, 24 Oct 2022 08:45:40 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omwpk-0005WD-TR for 58507@debbugs.gnu.org; Mon, 24 Oct 2022 08:45:39 -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 1omwpX-0003le-2q; Mon, 24 Oct 2022 08:45:31 -0400 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=t1qJn58wYX+2SaklRDFvGzvpsKZJ8uRYk+Db0C/Rbaw=; b=BQ357X73+tjeQV4RywvQ nFQMzuHq15v8+BDnm0H5s+DvGoN4E/FLkuWkZdYqDuOLE+392ucMrSDE6nyd03AA9LtXu/qwHqv7P t9UUh9dVFHfAHoxKXqQe5CMkUzuuMxo2K4j2QJl1DN0f+WC0ANPinKfaKDQvIJE1RJdEN5TP57nA1 W0u5jYt6BFcXyU8n8xYz4bnQfMuW2uTAwWD3DuqRC5YPJtzUR0awVyr7XvosrGcf2lEesecjjdfzQ A2BDRzt21qFrqAJoXUj/VbWC7MKXGxyGP2OfLmTOfzXMk1qAF6jX3pA2EOrzUx3GianwjH8Jlzwtz DuUyID/9jgVpOQ==; 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 1omwpU-0007Sl-Tt; Mon, 24 Oct 2022 08:45:22 -0400 In-Reply-To: (message from Juhana Sadeharju on Mon, 24 Oct 2022 03:22:44 +0300) 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246106 Archived-At: > From: Juhana Sadeharju > Date: Mon, 24 Oct 2022 03:22:44 +0300 > Cc: 58507@debbugs.gnu.org > > First I create a new file with c-x c-f. By default, it has coding system iso-latin-9-dos. > > I change the coding system to utf-8 via the buffer's bottombar. Char "0" changes to "U". > > Then I write "äöäöäö" and quit emacs. > > When I rerun the emacs and open the text, the "öä" looks wrong and coding system is back at iso-latin-9-dos. > > I use Total Commander's View to verify the file is ok. The file goes wrong only if I now save the buffer. This is expected: the short file that you created can be interpreted both as UTF-8 and as ISO-8859-9. When there is ambiguity in detection of the encoding, Emacs prefers the locale-dependent defaults, which in your case are ISO-8859-9. > What helps is c-x ret r which asks the coding system -- I type utf-8. > > Also helps when I add ";;; -*- coding: utf-8-dos; -*-" to the top of file. I will use this method as solution, but this > is too advanced for regular users -- please check what is the problem. These are indeed two ways of telling Emacs to visit the file as encoded in UTF-8.