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.help Subject: Re: call-process -> insert -> iso-latin-1-dos problem on Windows Date: Mon, 15 Jan 2024 14:34:16 +0200 Message-ID: <83fryyepx3.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12164"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 15 13:35:19 2024 Return-path: Envelope-to: geh-help-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 1rPMBS-0002tj-Dw for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 15 Jan 2024 13:35:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPMAk-00030D-4P; Mon, 15 Jan 2024 07:34:34 -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 1rPMAh-0002yf-6G for help-gnu-emacs@gnu.org; Mon, 15 Jan 2024 07:34:31 -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 1rPMAg-0002Xt-UF for help-gnu-emacs@gnu.org; Mon, 15 Jan 2024 07:34:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MkdKPTYJeMGot3ZsC2+C648oIllzybSqviy+1Pqv2FI=; b=BKQV7rihYD5f 0SDHGggo4Jzfqh1p6JWNX8+kql2RBQTFnP6wJussy9AsX4+SLJa2l0pi5jrKSCJF3wLQrmkCE0AfG MZfr2576zb2aOUiEXVKo+QcC8SER1tEo8h+yvVJghbtzpbSpM6C3l7y7Lcj5LhUcA9rqllgJWpl8D xrmDuO9k2ekYXTg6D66vZErxjau2KjsXQFSYPQDYN3f9ZLOm5Zhu05ewOvXG6vXd4xATeMahzT1mW htSMhlZCYFIg2GBSrxcamYB+4AG9bb+uoxSN7SqBJHruQloA+joDPlRdQ0SLDGv/cdBlD3iDHpS1I zaFVU23mJTCKf8Kh5MTDBg==; In-Reply-To: (message from Eduardo Ochs on Sun, 14 Jan 2024 20:09:41 -0300) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145737 Archived-At: > From: Eduardo Ochs > 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.