GitHub: Using UTF-8 encoding for files GitHub: Using UTF-8 encoding for files git git

GitHub: Using UTF-8 encoding for files


Wild guess: are you using TortoiseGit? Is that were you're seeing a default encoding set to cp1252?

If so, it's simply TortoiseGit using the default encoding of your Windows installation.

Edit: Exactly the same is true for the Git GUI

Here's a discussion from a git developer's mailing list giving an explanation:

  • Make diffs and blame default to the system (locale) encoding instead of hard-coding UTF-8.
  • Add a gui.encoding option to allow overriding it.
  • gitattributes still have the final word.

The rationale for this is Windows support:

  1. Windows people are accustomed to using legacy encodings for text files. For many of them defaulting to utf-8 will be counter-intuitive.
  2. Windows doesn't support utf-8 locales, and switching the system encoding is a real pain. Thus the option.