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: call-process -> insert -> iso-latin-1-dos problem on Windows
Date: Mon, 15 Jan 2024 14:34:16 +0200	[thread overview]
Message-ID: <83fryyepx3.fsf@gnu.org> (raw)
In-Reply-To: <CADs++6jc9BXPKqd8Ry5BA53zSvE4GvGeLjjJSomeng=OB-eMiw@mail.gmail.com> (message from Eduardo Ochs on Sun, 14 Jan 2024 20:09:41 -0300)

> From: Eduardo Ochs <eduardoochs@gmail.com>
> Date: Sun, 14 Jan 2024 20:09:41 -0300
> 
> I have a function called `find-wget' that works well in *NIX-like
> systems - it calls wget, puts the output in the temporary buffer, and
> on unices Emacs always chooses the right encoding... but when I run it
> on Windows, and I call wget like this,
> 
>   wget -q -O - http://anggtwu.net/LUA/Dang1.lua
> 
> where Dang1.lua is a file in UTF-8, then Emacs switches the encoding
> of output buffer to iso-latin-1-dos...

Emacs cannot reliably distinguish between UTF-8 and Latin-N encodings,
and errs in favor of the latter when the locale's encoding prefers
that.  Your Lisp programs should not assume Emacs will auto-detect
UTF-8 every time; instead, if you know for sure that a program's
output is encoded in UTF-8, bind coding-system-for-read to 'utf-8
around the call to call-process.



      parent reply	other threads:[~2024-01-15 12:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-14 23:09 call-process -> insert -> iso-latin-1-dos problem on Windows Eduardo Ochs
2024-01-15  0:17 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-01-15  1:25 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-01-15 12:34 ` 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=83fryyepx3.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).