unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to save a file with embedded unicode maths symbols
Date: Tue, 10 Mar 2020 16:43:46 +0200	[thread overview]
Message-ID: <83zhco9snx.fsf@gnu.org> (raw)
In-Reply-To: <lxmu8o1odt.fsf@cochabamba.vanoostrum.org> (message from Pieter van Oostrum on Tue, 10 Mar 2020 11:43:26 +0100)

> From: Pieter van Oostrum <pieter-l@vanoostrum.org>
> Date: Tue, 10 Mar 2020 11:43:26 +0100
> 
> > I have:
> >
> > GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
> >  of 2019-04-13
> >
> > I have not made any specific encoding config changes as far as I am aware.
> >
> > Yes I opened the file in emacs.
> >
> > Is there an emacs option to switch to utf-8 encoding when I view the file?
> 
> Yes. You can use  C-x RET c (universal-coding-system-argument), then specify utf-8, and the give the command to open the file (like C-x C-f).
> 
> If you regularly work with utf-8 files (something I would recommend) then it is easier to set utf-8 as your preferred encoding. As it seems this is currently not the case, check your LANG environment variable or related ones. It may specify something that causes latin-1 or so to be the default encoding. As you experience, latin-1 or even Windows-1252 (which is an extension of latin-1) are not sufficient for today's international/scientific environment. More specifically, it cannot encode the Φ.

Since the OP is on Windows, the LANG variable cannot possibly help
(it's unset on Windows, and you cannot set to anything whose codeset
is UTF-8 anyway), and making UTF-8 the preferred encoding is not
recommended.  Instead, I suggest using file-local variables or coding
cookie (or .dir-locals.el, if this should hold for more than a couple
of files in the same directory).



      parent reply	other threads:[~2020-03-10 14:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e68aa1ba-3e40-4d3d-b037-9c9560a257b5@googlegroups.com>
2020-03-09 13:14 ` How to save a file with embedded unicode maths symbols Pieter van Oostrum
     [not found]   ` <mailman.2329.1583759953.2412.help-gnu-emacs@gnu.org>
     [not found]     ` <dfb30828-24b0-47d0-bcbb-7e732b29e22e@googlegroups.com>
2020-03-09 16:27       ` Pieter van Oostrum
     [not found]         ` <mailman.2341.1583771249.2412.help-gnu-emacs@gnu.org>
     [not found]           ` <5e13d072-68da-4d3b-a62f-e48c0543b0f9@googlegroups.com>
2020-03-10 10:43             ` Pieter van Oostrum
2020-03-10 13:03               ` Stefan Monnier
2020-03-10 14:45                 ` Eli Zaretskii
2020-03-10 14:54                   ` Stefan Monnier
2020-03-10 15:14                     ` Eli Zaretskii
2020-03-10 14:43               ` Eli Zaretskii [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83zhco9snx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).