Git: Diff does not handles character encoding other than UTF-8? Git: Diff does not handles character encoding other than UTF-8? powershell powershell

Git: Diff does not handles character encoding other than UTF-8?


Git does not really care about character encodings at all. A file is just a bunch of bytes.

Displaying is done by your terminal. If it is configured to decode as UTF-8 your latin-2 file seems broken. If it is configured to decode as latin-2 you UTF-8 file seems broken.

Maybe the encoding attribute (see git help gitattributes) is able to give some tools a hint how to decode a file correctly, but I never used this.For example github might be smart enough to look at this attribute and decode those files differently.