From unknown Sat Jun 14 03:47:13 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#48375 <48375@debbugs.gnu.org> To: bug#48375 <48375@debbugs.gnu.org> Subject: Status: coding-system-for-read in net-utils-run-simple is not properly set Reply-To: bug#48375 <48375@debbugs.gnu.org> Date: Sat, 14 Jun 2025 10:47:13 +0000 retitle 48375 coding-system-for-read in net-utils-run-simple is not properl= y set reassign 48375 emacs submitter 48375 iquiw severity 48375 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed May 12 05:39:46 2021 Received: (at submit) by debbugs.gnu.org; 12 May 2021 09:39:46 +0000 Received: from localhost ([127.0.0.1]:38189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lglLG-000394-In for submit@debbugs.gnu.org; Wed, 12 May 2021 05:39:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:44620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lglLF-00038t-5Y for submit@debbugs.gnu.org; Wed, 12 May 2021 05:39:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lglLD-0002L7-CI for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 05:39:44 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:39634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lglL9-00041l-98 for bug-gnu-emacs@gnu.org; Wed, 12 May 2021 05:39:43 -0400 Received: by mail-pg1-x533.google.com with SMTP id s22so17775677pgk.6 for ; Wed, 12 May 2021 02:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=0Kzp45aCriQqS8gNYhM8BaCH/41YqeRlbF0cnemjdS0=; b=QGQuVWLEXC6V05vG6nOo/30RPP6kiIppBxKNAlfHe+ndICawaTGaiMRHISPjALUPIV 1hrfmJnJtUKiOQNb57+kPOl+QoL507w2pNIeOvwlklksvC68kAPAND+2QS3fvGZkX3Ww KzFR125iAjqUngU2bys4OUcr7kUf36ySL8gPW95TwCLhvVS5BnkwZSY2YGr5R/ORcwIU Il/9p+MjruD+BE0hguCn2Vq2usiLIE1PSIIE4aNZ7pZ0gSj9kJXMWo6eLihesW2eBE7U keSi9/BkQVwA8rMr2e8dsXsYtnCgWyKCI1zpvsGj00dbxuOOTNsevT9dyYD7NFQ/Z8Fr g9Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=0Kzp45aCriQqS8gNYhM8BaCH/41YqeRlbF0cnemjdS0=; b=a1homK8uVhStTAmjG6AkygX1B6fGGUWOWSOmZ+iuDL4Y/8Qwk/uxXKERg/Mrnc/poJ AESYrgalZ+hl4nphvHwff1E22HNq3SnONwF6oUAd5nzMN1O8noAEmUzj9CsZyCzovfTJ usowHkcEXiTl1yU51An6qCyrwvbkcNTbRU2ktplicDGs3tsXaAxnhtobp5CzV7jENecU Jt069T0ScFvYLBpAMRrXwuzCAF1jQJvYWMkf10lcdu0QN4svs/xwl9g5gNMHXcuIQaS/ gGd9NJUB77K7YOrLCTTVikEMjZSUb1mysE5fuSFwK2o6R/zVIiUJISkT9LZpceEuucoM vhEQ== X-Gm-Message-State: AOAM5318QvGZ4R/Y45TPOvLk/WWJHuTJvZNC3Lyer7niQuXZLxouth5B GpmtuLHpiT3fhl1ttMbO3MTm4RYTikUFvKgJpMdP/3Z/42nBrw== X-Google-Smtp-Source: ABdhPJzQUvi9dchRGxyc6dfeR5i9G+EPoNALsIw5a0mACbYwPu+RfDIOMYzhLBz0MSNO5WTz8r8qy+6cbBQUX35uBXk= X-Received: by 2002:aa7:8201:0:b029:27b:9b59:8676 with SMTP id k1-20020aa782010000b029027b9b598676mr34560872pfi.47.1620812376129; Wed, 12 May 2021 02:39:36 -0700 (PDT) MIME-Version: 1.0 From: iquiw Date: Wed, 12 May 2021 18:39:25 +0900 Message-ID: Subject: coding-system-for-read in net-utils-run-simple is not properly set To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=iku.iwasa@gmail.com; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) In the following code, `let' binding of `coding-system-for-read' covers only `erase-buffer' call. https://emba.gnu.org/emacs/emacs/-/blob/47070ed39eda524d334e5f82dc7f4a50b8d3252c/lisp/net/net-utils.el#L366-375 So it does not affect to executed process and output characters are garbled. e.g. "M-x ifconfig" on Windows. `net-utils-run-program' (e.g. "M-x ping") has no problem. Thanks in advance, Iku From debbugs-submit-bounces@debbugs.gnu.org Sat May 15 04:26:45 2021 Received: (at 48375) by debbugs.gnu.org; 15 May 2021 08:26:45 +0000 Received: from localhost ([127.0.0.1]:47482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhpdF-0002fN-8l for submit@debbugs.gnu.org; Sat, 15 May 2021 04:26:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhpdB-0002f9-NU for 48375@debbugs.gnu.org; Sat, 15 May 2021 04:26:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37810) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhpd6-0004JR-HP; Sat, 15 May 2021 04:26:36 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1674 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 1lhpd5-000703-56; Sat, 15 May 2021 04:26:36 -0400 Date: Sat, 15 May 2021 11:26:32 +0300 Message-Id: <83bl9cxv0n.fsf@gnu.org> From: Eli Zaretskii To: iquiw In-Reply-To: (message from iquiw on Wed, 12 May 2021 18:39:25 +0900) Subject: Re: bug#48375: coding-system-for-read in net-utils-run-simple is not properly set References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48375 Cc: 48375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: iquiw > Date: Wed, 12 May 2021 18:39:25 +0900 > > In the following code, `let' binding of `coding-system-for-read' > covers only `erase-buffer' call. > > https://emba.gnu.org/emacs/emacs/-/blob/47070ed39eda524d334e5f82dc7f4a50b8d3252c/lisp/net/net-utils.el#L366-375 > > So it does not affect to executed process and output characters are garbled. > e.g. "M-x ifconfig" on Windows. Thanks. Does the patch below fix the problem? diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 24f2aba..90cca7d 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -363,24 +363,24 @@ net-utils-run-simple (when proc (set-process-filter proc nil) (delete-process proc))) - (let ((inhibit-read-only t) - (coding-system-for-read - ;; MS-Windows versions of network utilities output text - ;; encoded in the console (a.k.a. "OEM") codepage, which is - ;; different from the default system (a.k.a. "ANSI") - ;; codepage. - (if (eq system-type 'windows-nt) - (intern (format "cp%d" (w32-get-console-output-codepage))) - coding-system-for-read))) + (let ((inhibit-read-only t)) (erase-buffer)) (net-utils-mode) (setq-local net-utils--revert-cmd `(net-utils-run-simple ,(current-buffer) ,program-name ,args nodisplay)) - (set-process-filter - (apply #'start-process program-name - (current-buffer) program-name args) - #'net-utils-remove-ctrl-m-filter) + (let ((coding-system-for-read + ;; MS-Windows versions of network utilities output text + ;; encoded in the console (a.k.a. "OEM") codepage, which is + ;; different from the default system (a.k.a. "ANSI") + ;; codepage. + (if (eq system-type 'windows-nt) + (intern (format "cp%d" (w32-get-console-output-codepage))) + coding-system-for-read))) + (set-process-filter + (apply #'start-process program-name + (current-buffer) program-name args) + #'net-utils-remove-ctrl-m-filter)) (unless nodisplay (display-buffer (current-buffer))))) (defun net-utils--revert-function (&optional _ignore-auto _noconfirm) From debbugs-submit-bounces@debbugs.gnu.org Sat May 15 05:32:29 2021 Received: (at 48375) by debbugs.gnu.org; 15 May 2021 09:32:30 +0000 Received: from localhost ([127.0.0.1]:47572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhqer-0006Ya-Eb for submit@debbugs.gnu.org; Sat, 15 May 2021 05:32:29 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:40693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhqek-0006YD-6X for 48375@debbugs.gnu.org; Sat, 15 May 2021 05:32:23 -0400 Received: by mail-pj1-f54.google.com with SMTP id b9-20020a17090a9909b029015cf9effaeaso2855435pjp.5 for <48375@debbugs.gnu.org>; Sat, 15 May 2021 02:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=boQ/WYqkVOgrHsEMJyi4ggK0Ri/4OsEzGZzxNvCskok=; b=ML7l62iZ8B6edzlpOxPSL1u+6knNaSYL1ENsqk/NJccCwQ8hJaep1P4TFezy+B0soX TGQNpp93DIdD+BbYH/oSQbzDJ6tRCnYD4bzHcJ4U0nOXhdkhbdprGvG+X55JsFUIkSo+ RdrrEiyThZdkP6yXs/mPw3R132bbRJ0QihkznsnUACBzz1Ayr3WJFhbA/9J1ww6IDHtv N0Er/r03lR2Tf3xsAj+0FGSOz/YTHzAKrMCaHAZZN140N0hKin8Z1Iiik31sUJvAMlwy HUuRsax4dG5h+ZmIWfSdGtqdE0nLq1YqRy8Uqa+HH983QCj3q8U7sNLtgQbOYbgKtRlM 1w4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=boQ/WYqkVOgrHsEMJyi4ggK0Ri/4OsEzGZzxNvCskok=; b=SIudyx7kjJ+alMHMOlLapcUfqjVUPOvGFaxPs+T23cC2arvpK0JuIDZ14BJYVmOPfP +7L0EaY1uzGpRosJQXUlFzPLtj5TddiQw1G4Yn6rCO+XV7BlhGNIooeO8QvFo5j4Oez9 N9eA2FjlakzjCb2uNVPCKfguwSlSJf+BeeIEoc4bc0sG3/hZawWfX9IfXC3tNd55We2D 9EeGI5UA+/69Rd2YzeM4qqPb6SH5ZkC/msN9Ptz95n0vUo2g1jQ3mAGKgVa0MUolAd/K 0Smicxy3tVP32ZXwTRPA3YBrdjl9buytnvS5LZzl9947AqQ0NOMu3ceTc/KGCOUdrLQa Z46g== X-Gm-Message-State: AOAM532X8vbGh8aQ0T2LsB3XW6qqHkYAwqvi5RMn/7fxI9xppj73DlHB KpJonN04aNysZwibG8x8z9DGvO4L4wBJYbjA0GwOoRmjRUU= X-Google-Smtp-Source: ABdhPJzrlvVeCTAnSduHTHc7ixxDmuzhIBo4qe5GEtkCf5ElUhCbErmoBAShX9V2r75M/t1A31L+KidYKGgBCqqe278= X-Received: by 2002:a17:902:8e88:b029:ee:b947:d7df with SMTP id bg8-20020a1709028e88b02900eeb947d7dfmr49060081plb.48.1621071136189; Sat, 15 May 2021 02:32:16 -0700 (PDT) MIME-Version: 1.0 References: <83bl9cxv0n.fsf@gnu.org> In-Reply-To: <83bl9cxv0n.fsf@gnu.org> From: iquiw Date: Sat, 15 May 2021 18:32:05 +0900 Message-ID: Subject: Re: bug#48375: coding-system-for-read in net-utils-run-simple is not properly set To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48375 Cc: 48375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, May 15, 2021 at 5:26 PM Eli Zaretskii wrote: > > > From: iquiw > > Date: Wed, 12 May 2021 18:39:25 +0900 > > > > In the following code, `let' binding of `coding-system-for-read' > > covers only `erase-buffer' call. > > > > https://emba.gnu.org/emacs/emacs/-/blob/47070ed39eda524d334e5f82dc7f4a50b8d3252c/lisp/net/net-utils.el#L366-375 > > > > So it does not affect to executed process and output characters are garbled. > > e.g. "M-x ifconfig" on Windows. > > Thanks. Does the patch below fix the problem? Yes, it works fine with the patch. Thank you! From debbugs-submit-bounces@debbugs.gnu.org Sat May 15 05:39:32 2021 Received: (at 48375-done) by debbugs.gnu.org; 15 May 2021 09:39:33 +0000 Received: from localhost ([127.0.0.1]:47609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhqlg-0006kl-NT for submit@debbugs.gnu.org; Sat, 15 May 2021 05:39:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhqle-0006kY-Qj for 48375-done@debbugs.gnu.org; Sat, 15 May 2021 05:39:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39754) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhqlZ-0008AK-KE; Sat, 15 May 2021 05:39:25 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2198 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 1lhqlZ-0003J9-6b; Sat, 15 May 2021 05:39:25 -0400 Date: Sat, 15 May 2021 12:39:25 +0300 Message-Id: <835yzkxrn6.fsf@gnu.org> From: Eli Zaretskii To: iquiw In-Reply-To: (message from iquiw on Sat, 15 May 2021 18:32:05 +0900) Subject: Re: bug#48375: coding-system-for-read in net-utils-run-simple is not properly set References: <83bl9cxv0n.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48375-done Cc: 48375-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: iquiw > Date: Sat, 15 May 2021 18:32:05 +0900 > Cc: 48375@debbugs.gnu.org > > > > In the following code, `let' binding of `coding-system-for-read' > > > covers only `erase-buffer' call. > > > > > > https://emba.gnu.org/emacs/emacs/-/blob/47070ed39eda524d334e5f82dc7f4a50b8d3252c/lisp/net/net-utils.el#L366-375 > > > > > > So it does not affect to executed process and output characters are garbled. > > > e.g. "M-x ifconfig" on Windows. > > > > Thanks. Does the patch below fix the problem? > > Yes, it works fine with the patch. > Thank you! Thanks for testing, I installed the fix on the master branch, and I'm closing this bug report. From unknown Sat Jun 14 03:47:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 12 Jun 2021 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator