Reputation: 122
Specifically what encoding to use if the repo has both code and docs? Any .md or .htm files are saved as UTF-8, but code is cp1252 (my compiler doesn't like the 3-byte BOM which Windows adds to UTF-8 files).
As seen in Git GUI tool (Edit -> Options...):
Frankly, does it even matter what setting I choose?
My system is Windows 8.1, and the system encoding is cp1252
Upvotes: 5
Views: 15621
Reputation: 94397
The setting in git GUI only sets the default encoding. Real encoding should be set via .gitattributes. For example:
echo '*.html encoding=utf-8' >> .gitattributes
echo '*.c encoding=cp1252' >> .gitattributes
PS. What editor do you use that you cannot configure BOM in it? I recommend to disable BOM and use one encoding for all text files.
Upvotes: 9