git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Collin Funk <collin.funk1@gmail.com>
Date
Jan 7, 2026, 01:35 UTC
Message-ID
<87secimchc.fsf@gmail.com>
In-Reply-To
<aV2ZS1lvLivi8xRH@fruit.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 10 quoted lines
> 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
Previous: brian m. carlsonNext: Phillip Wood
Message 10 of 13 in “ignores: handle non UTF-8 exclude files”
  1. ignores: handle non UTF-8 exclude filesMatthieu Beauchamp-Boulay via GitGitGadget, Jan 3, 2026
  2. Junio C HamanoJan 4, 2026
  3. Matthieu BeauchampJan 6, 2026
  4. Torsten BögershausenJan 4, 2026
  5. Matthieu BeauchampJan 6, 2026
  6. Phillip WoodJan 7, 2026
  7. brian m. carlsonJan 4, 2026
  8. Matthieu BeauchampJan 6, 2026
  9. brian m. carlsonJan 6, 2026
  10. Collin FunkJan 7, 2026
  11. Phillip WoodJan 7, 2026
  12. brian m. carlsonJan 7, 2026
  13. Collin FunkJan 8, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.