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.bugs Subject: bug#75207: Fwd: bug#75207: 29.4; Path conversion from native codepage to UTF-8 fails when Windows is set by default to UTF-8 Date: Fri, 03 Jan 2025 17:25:31 +0200 Message-ID: <86a5c7hqc4.fsf@gnu.org> References: <000001db5ab4$06cec970$146c5c50$@0lock.xyz> <3gvOgDDbA00XBG4Xyu7q8lDJKQVYNo4pJ_Uzu35u0KNS8rhQ9PrenO2Kcz7GDHPNtUng9gnBpgPXtHMty_d_Bw==@protonmail.internalid> <86a5cdnfwc.fsf@gnu.org> <003001db5d81$a8f144b0$fad3ce10$@0lock.xyz> <87F91035-E0D9-4650-B332-10E4E8AD0AEF@0lock.xyz> <86ed1kghej.fsf@gnu.org> <000701db5dec$b8751ef0$295f5cd0$@0lock.xyz> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1450"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 75207@debbugs.gnu.org To: michal@0lock.xyz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 03 16:26:18 2025 Return-path: Envelope-to: geb-bug-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 1tTjZ3-00009T-6v for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Jan 2025 16:26:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTjYq-0005tz-N2; Fri, 03 Jan 2025 10:26:04 -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 1tTjYo-0005tn-Hc for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 10:26:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTjYo-0001sw-9K for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 10:26:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=VDBytIlSkiX6l8ZTsmZ/AQlkXTJ3E4RMDfuXyTYZCv4=; b=D8oNTRe9hmh0Pb0AwFFZy14WFj5QIHUStgm68nD+aTqzMzoUQs8O8iBeu8+2gq3aAXA57xXkOCyvEYVzCAYHV7TEnlVk8UGxq+e2KpcgeHBy423KiDrYJ+A0uPYrYlMxfxWr0YZ0CjH95iDAsjUhfWu7nHtV1ztWyOeJ0r7bTJay5PkC/SbZ48BqMfDWHSObhZGpg5h/xWmfZTW1j3d7Rj/iBoY9yoPsX9XtH6iULkKvJuXlZ3B0w8CYd6d6oAmCyPpWye/lIgt4D68feHXifFbwM1e5CWQgkB0L699qVS5TlZnAP2x/LisbmYMjbJa2Zf/o9PM8B7ClhsLZmPjKaA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTjYn-0005j7-Uv for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 10:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Jan 2025 15:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75207 X-GNU-PR-Package: emacs Original-Received: via spool by 75207-submit@debbugs.gnu.org id=B75207.173591794521944 (code B ref 75207); Fri, 03 Jan 2025 15:26:01 +0000 Original-Received: (at 75207) by debbugs.gnu.org; 3 Jan 2025 15:25:45 +0000 Original-Received: from localhost ([127.0.0.1]:51611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTjYW-0005hr-V1 for submit@debbugs.gnu.org; Fri, 03 Jan 2025 10:25:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46330) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tTjYU-0005he-V0 for 75207@debbugs.gnu.org; Fri, 03 Jan 2025 10:25:43 -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 1tTjYP-0001qO-JX; Fri, 03 Jan 2025 10:25:37 -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=VDBytIlSkiX6l8ZTsmZ/AQlkXTJ3E4RMDfuXyTYZCv4=; b=RwM0wd84iz3U hmMZ/WfHhdvh9xg5ogQkbTyvS3Op7gF+/ttEhzSef7uoonFOsLPKAm2M9EPovo7i0dzYshsRr/Yh3 17MOfuqf8mclaH/eg/U+ldvsaxIAxYWyDZ1EhxrFoZrzEwaNgZYI5c++GTYqr24Y2C+DP7J7YkaIm htexjymczBUT1+0Kz/26PtbSaWOeuFkwKQHF/xCYAIoMwZ5pJ3yuVufYy8EZ7rI28bhPuNXsltYEk t/ZGhdlQNRfdgpNsfNVr7EZWP4WXYzvA57NiBunMeZIt97ZfCXn+TawBsZovFUD8vffTN6IOjSjN4 3vrXM+zqVvu8RnEch+6CfA==; In-Reply-To: <000701db5dec$b8751ef0$295f5cd0$@0lock.xyz> (michal@0lock.xyz) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298288 Archived-At: > Date: Fri, 03 Jan 2025 14:35:26 +0000 > From: michal@0lock.xyz > Cc: 75207@debbugs.gnu.org > > I've just built Emacs on somewhat new revision (577714e3fe) and cannot repro it there. > Tag emacs-29.1 does not build by default on Windows so I didn't check. > > My theory is that maybe the codepage of the machine Emacs was built on influences this?? Yes, it does, according to my reading of the code. When we went from unexec to pdumper builds, we introduced a bug whereby the relevant variables are assigned values that come from the dump stage, and not reinitialized after that. If Emacs was dumped when the system codepage was different, you will see problems when the dumped Emacs starts with a different codepage, AFAICT. As I said, this is not limited to UTF-8, so it is good we found this problem. > Or this has just been fixed on the latest version. No, I don't think so. I see the problem on the latest master branch. > I debugged a bit and it looks like w32_ansi_code_page is set to 1252 at some point. AFAICT, that happens when we load the pdumper file. > M-: w32-multibyte-code-page -> 0 > M-: locale-coding-system -> cp65001 > M-: file-name-coding-system -> nil > M-: default-file-name-coding-system -> cp65001 OK, I think this confirms my hypothesis. I'll try to come up with a patch, probably tomorrow. > > We think that PATH is encoded in Windows-1252 codepage, and the question > > is why and where do we err. The above additional values I ask about might > > help answer that question. > > I can say for sure that it is not When I say "we think", I mean Emacs thinks that, mistakenly. > > If I send you a C-level patch, are you able to build Emacs after patching it, > > preferably the master branch of our Git repository? > > Sure. OK, but you'll need to build Emacs with a different system codepage to see the effects of the fix.