From: "brian m. carlson" <sandals@crustytoothpaste•net>
To: Matthieu Beauchamp <matthieu.beauchamp.boulay@gmail•com>
Cc: Matthieu Beauchamp-Boulay via GitGitGadget
<gitgitgadget@gmail•com>,
git@vger•kernel.org, Matheus Tavares <matheus.tavb@gmail•com>,
Johannes Schindelin <johannes.schindelin@gmx•de>
Subject: Re: [PATCH] ignores: handle non UTF-8 exclude files
Date: Tue, 6 Jan 2026 23:22:51 +0000 [thread overview]
Message-ID: <aV2ZS1lvLivi8xRH@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <CALH9GrYOjb92gjrtdjwapFH9L73XGg1Kan8uz1aVLpSXNURi+Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]
On 2026-01-06 at 20:45:56, Matthieu Beauchamp wrote:
> On Sun, Jan 4, 2026 at 2:40 PM brian m. carlson
> <sandals@crustytoothpaste•net> wrote:
> > Ah, yes, here's the problem. UTF-16LE is used on Windows, and on
> > Windows, Git stores pathnames as if they were converted into UTF-8, so
> > you do need to write the filenames in UTF-8 in the ignore file.
> >
>
> Yes, the conversion from UTF16-LE to UTF-8 would need to be platform
> specific.
We typically don't want platform-specific behaviour in Git. Many Git
contributors do not work on Windows but we want things to work as much
as possible identically across all platforms because it makes
development easier, as well as making it easier for users to reason
about the project. I, for one, don't have a Windows system (nor do I
want one) but I do want my Git code to just work there.
As an example, we still use a POSIX shell in aliases and other settings
on Windows despite the fact that PowerShell is built into Windows
because it means that aliases and similar functionality just work
correctly regardless of platform and it allows users to write a config
file that works everywhere.
Instead of trying to force Git to gracefully handle UTF-16 in its config
files, my strong recommendation is to adjust your PowerShell scripts to
use UTF-8 instead[0] or use a POSIX shell. I'll note that Microsoft's
new Edit text editor[1] defaults to UTF-8 (and, except on Windows, LF
line endings), so I know that Microsoft understands that UTF-8 is the
proper encoding to use on the Internet today.
[0] https://stackoverflow.com/questions/5596982/using-powershell-to-write-a-file-in-utf-8-without-the-bom
[1] Available at https://github.com/microsoft/edit and apparently
shipped with Windows. I will say that I was impressed at its
functionality for a 231 KiB binary footprint.
--
brian m. carlson (they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2026-01-06 23:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-03 22:16 [PATCH] ignores: handle non UTF-8 exclude files Matthieu Beauchamp-Boulay via GitGitGadget
2026-01-04 2:54 ` Junio C Hamano
2026-01-06 19:52 ` Matthieu Beauchamp
2026-01-04 17:35 ` Torsten Bögershausen
2026-01-06 20:32 ` Matthieu Beauchamp
2026-01-07 14:36 ` Phillip Wood
2026-01-04 19:40 ` brian m. carlson
2026-01-06 20:45 ` Matthieu Beauchamp
2026-01-06 23:22 ` brian m. carlson [this message]
2026-01-07 1:35 ` Collin Funk
2026-01-07 14:28 ` Phillip Wood
2026-01-07 23:38 ` brian m. carlson
2026-01-08 1:13 ` Collin Funk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aV2ZS1lvLivi8xRH@fruit.crustytoothpaste.net \
--to=sandals@crustytoothpaste$(echo .)net \
--cc=git@vger$(echo .)kernel.org \
--cc=gitgitgadget@gmail$(echo .)com \
--cc=johannes.schindelin@gmx$(echo .)de \
--cc=matheus.tavb@gmail$(echo .)com \
--cc=matthieu.beauchamp.boulay@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox