Subject: Re: [PATCH] ignores: handle non UTF-8 exclude files

From: Collin Funk <[email-masked]>
Date: Tue, 06 Jan 2026 17:35:11 -0800

"brian m. carlson" <[email-masked]> writes:

> 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.
>
> [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.

Does it handle text that is not UTF-8 encoded?

An unfortunate trend that I have seen with Rust programs is that they
completely disregard the systems locale. E.g. using
LC_ALL=en_US.ISO-8859-1 and passing an "À" character as an option will
typically fail since it is encoded as 0xC0 which is not a valid UTF-8
character.

I figured it was worth bringing up since Git may wany to think about it
some before introducing more Rust. I think it can be worked around by
using OsString [1], but I guess many people choose not to.

Collin

[1] https://doc.rust-lang.org/std/ffi/struct.OsString.html