git does not commit charset changes

1

Hello,

I created several files in ISO-8859-1 but now I'm converting them to UTF-8.

However, git does not identify this coding change and even if I try to force a commit (adding any text), the charset of the file remains the same.

    
asked by anonymous 03.02.2017 / 16:04

1 answer

1

GIT does not change the encoding of the file in any way. If the file is in ISO-8859-1 the commit will write the file in this way, same thing for UTF-8.

When a file is converted, git will identify which characters have changed and when you make a git status the file should appear as changed. If it did not appear or there were no characters to be converted, or the conversion did not happen.

Another possibility is that the conversion is only changing the charset of the file without converting the characters of the file, there it will remain the same, even the file being with a different charset.

    
15.02.2017 / 18:52