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

From: Phillip Wood <[email-masked]>
Date: Wed, 7 Jan 2026 14:36:19 +0000

On 06/01/2026 20:32, Matthieu Beauchamp wrote:
> 
> Yes you are correct, but I want to address the issues for users who may not
> realize that they used the wrong encoding when creating their exclude file.
> For that case I don't see how the fact that powershell can be configured to
> UTF-8 helps, aside from preventing repeating the same mistake.

My concern with that is that it ends up hampering collaboration with 
people using bash on Windows or a native shell on other platforms. If 
they append to a UTF-16 encoded .gitignore with "echo path >>.gitignore" 
you'll end up with a mix of encodings in the same file. Similarly if you 
use powershell to append to an existing file that is UTF-8 encoded with 
"echo hello >>.gitignore" is the appended text UTF-16 encoded resulting 
in mixed encodings in the same file?

Thanks

Phillip