Subject: Re: bug#61934: 28.2; Exec format error when `default-directory` contains non-ASCII characters on Windows 11

From: Eli Zaretskii <[email-masked]>
Date: Fri, 03 Mar 2023 16:41:25 +0200

> Date: Fri, 03 Mar 2023 14:56:32 +0100
> From: "Grzegorz Kowzan" <[email-masked]>
> 
> Calling external commands fails on Emacs under Windows 11 if
> `default-directory' contains non-ASCII characters. Steps to reproduce:
> 
> 0. Start emacs -Q
> 1. Create directory C:/zażółćgęśląjaźń.
> 2. Enter the directory with dired.
> 3. Press M-! and try executing any command.
> 4. Minibuffer shows error message: "Spawning child process: Exec format error"

This is expected.  Emacs on Windows supports starting programs only if
the command-line arguments, including the program's file name, can be
encoded in the system's codepage.  According to this bug report, your
system codepage is 1252, and the file name you show cannot be encoded
using that codepage.

This is a limitation of how Emacs on Windows invokes programs, but the
root cause is that many programs that run on Windows only support the
current codepage, and cannot support UTF-8 due to Windows misfeatures.

Sorry.