all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juhana Sadeharju <johanrainhill@gmail.com>
Cc: 58507@debbugs.gnu.org
Subject: bug#58507: Emacs does not preserve the coding system
Date: Mon, 24 Oct 2022 15:45:07 +0300	[thread overview]
Message-ID: <83a65lqtkc.fsf@gnu.org> (raw)
In-Reply-To: <CAByt=Pcq=d8RNsqr2TV=4t-QKOYOK-hOrc9ZLsXYJSNA1R16og@mail.gmail.com> (message from Juhana Sadeharju on Mon, 24 Oct 2022 03:22:44 +0300)

> From: Juhana Sadeharju <johanrainhill@gmail.com>
> 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.





  reply	other threads:[~2022-10-24 12:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14  6:02 bug#58507: Emacs does not preserve the coding system Juhana Sadeharju
2022-10-14 10:42 ` Eli Zaretskii
2022-10-24  0:22   ` Juhana Sadeharju
2022-10-24 12:45     ` Eli Zaretskii [this message]
     [not found] ` <handler.58507.B.166574069410702.ack@debbugs.gnu.org>
2023-02-09  8:56   ` bug#58507: Acknowledgement (Emacs does not preserve the coding system) Juhana Sadeharju
2023-02-09  9:52     ` Eli Zaretskii
2023-09-03  9:30       ` bug#58507: Emacs does not preserve the coding system Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a65lqtkc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=58507@debbugs.gnu.org \
    --cc=johanrainhill@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.