Subject: Re: bug#56469: 29.0.50; Unibyte dir in directory_files_internal

From: Stefan Monnier <[email-masked]>
Date: Sun, 10 Jul 2022 11:19:22 -0400

> That could be the situation _today_, but that's just sheer luck (or
> lack thereof).  In general, all the file-handling code we have in
> fileio.c and dired.c should be equally prepared to handle unibyte
> non-ASCII file names and multibyte file names, because we may need
> that any time.  When we make changes in Emacs, we shouldn't be worried
> whether those changes could cause some dired.c code be called early on
> during Emacs startup.

Agreed.  In the updated comment I noted that we have a bug when we do

    (let ((file-name-coding-system 'binary))
      (directory-files "/tmp/été/" 'full)

because we'll be concatenating the multibyte string "/tmp/été/" with
the undecoded unibyte strings of the names of files in that directory.

        Stefan