From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Micha=C5=82?= Lach via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 11:49:34 +0000 Message-ID: <87F91035-E0D9-4650-B332-10E4E8AD0AEF@0lock.xyz> References: <000001db5ab4$06cec970$146c5c50$@0lock.xyz> <3gvOgDDbA00XBG4Xyu7q8lDJKQVYNo4pJ_Uzu35u0KNS8rhQ9PrenO2Kcz7GDHPNtUng9gnBpgPXtHMty_d_Bw==@protonmail.internalid> <86a5cdnfwc.fsf@gnu.org> <003001db5d81$a8f144b0$fad3ce10$@0lock.xyz> Reply-To: =?UTF-8?Q?Micha=C5=82?= Lach Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25793"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii To: 75207@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 03 14:28:23 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 1tThiu-0006UZ-Ga for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Jan 2025 14:28:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tThin-0007uZ-7C; Fri, 03 Jan 2025 08:28:14 -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 1tThik-0007tg-2e for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 08:28:11 -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 1tThij-0008J3-Pf for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 08:28:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=Qwr259nq/IghwD+10Br9r4lqY45fceNP5LLifMzdHmY=; b=jre1xktNGnL76TxEWfdhYJUr95fOSsD7hmHBAt28yYQEdrhFXcf+j29mF15D/0+/psic8hUOT5lR1suyS7ku2DY6AnOFE8yHIrenjpJoxQIGZdiznA1MXfhldF1CpA5PiTnRQkFbFOV1QwAMeTr5dJZwzvtN1F+D6O1h9jq7vfOepqfbzbgkFyfVAY+6y9yZ69jpB0ktqPcGs9gPX5VF9LMuSj6QNVaI2XIHkQy+2EQumbgX7VjK4nVCAmRs1P90sbxEjrru6gl96jQBZnrJ0R5raOnnPg5OzQTJuZ1T5BIIUuKlaFYWP/ztmz/cy0ISfnIFJIfLBv+Xs1zmtwzozA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tThbq-0006wW-KF for bug-gnu-emacs@gnu.org; Fri, 03 Jan 2025 08:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Micha=C5=82?= Lach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Jan 2025 13:21:02 +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.173591042326547 (code B ref 75207); Fri, 03 Jan 2025 13:21:02 +0000 Original-Received: (at 75207) by debbugs.gnu.org; 3 Jan 2025 13:20:23 +0000 Original-Received: from localhost ([127.0.0.1]:50007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tThbB-0006u0-JG for submit@debbugs.gnu.org; Fri, 03 Jan 2025 08:20:23 -0500 Original-Received: from mail-10625.protonmail.ch ([79.135.106.25]:41869) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tTgBY-0002fu-MP for 75207@debbugs.gnu.org; Fri, 03 Jan 2025 06:49:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0lock.xyz; s=protonmail; t=1735904978; x=1736164178; bh=Qwr259nq/IghwD+10Br9r4lqY45fceNP5LLifMzdHmY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=2lO3YFBRGRQWSbl8vn87PgbiukWAw6Y7z7Kr576JGhZLQs7xGgeJMqjKBYjXLmPOV yXyrsnNT+f++a7qZtZkIyK+SKe1LxVYkmyWlhsVotMir91eo6PzDTY94P8PCErMxv2 5zxGAywfr/pbasa45PAylZX+z1L5Gk+B5svHdvBXLk/OuLS5uNt9tPL9m24YPiH5Hb UcyuFC5kcnS/6q5tPvWC92+RJE1BCaZYWznfujwmJjrXU9+cfj2peBv2Be+pl424bk wyvBXO/NhOWM74A8AsKcfjOvVSBISAi2BuEzknDCrkQEqT7F21k27/CZ/ySNvQ42mI 1FzrY3ajA+RiA== In-Reply-To: <003001db5d81$a8f144b0$fad3ce10$@0lock.xyz> Feedback-ID: 123495485:user:proton X-Pm-Message-ID: 70e9ba3caf94c8b19096fd90bbaa280f0e422766 X-Mailman-Approved-At: Fri, 03 Jan 2025 08:20:14 -0500 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:298277 Archived-At: Forgot to CC the bug report mail. > Begin forwarded message: >=20 > From: > Subject: RE: bug#75207: 29.4; Path conversion from native codepage to UTF= -8 fails when Windows is set by default to UTF-8 > Date: 3 January 2025 at 02:48:53 CET > To: "'Eli Zaretskii'" > Reply-To: >=20 > M-: (getenv "ENU") -> nil > M-: current-locale-environment -> "ENG" > M-: w32-ansi-code-page -> 65001 > M-: (default-value 'buffer-file-coding-system) -> iso-latin-1-dos >=20 >> That said, presenting a clear recipe could help us gradually improve=20 >> support for >> this, as Windows improves its part in parallel. >=20 > Here is the repro. > 1. Put a path to your "PATH" environmental variable with some diacritic= =20 > character (=C5=82 in my case, maybe it won't work for some) > 2. M-: exec-path returns gibberish >=20 > Here, "Micha=C5=82" becomes "Micha=C3=85=E2=80=9A", you can get a similar= result if you do=20 > MultiByteToWideChar using Windows-1252 codepage on a UTF-8 path. >=20 > I've digged around and it looks like codepage_for_filenames (src/w32.c) a= t=20 > somepoint returns the Windows-1252 codepage. > This is then passed to MultiByteToWideChar() and the scenario that I=20 > described above happens. > I've checked this hypothesis with API Monitor and this is what actually= =20 > happens, I can attach a trace if you will find it useful.