git does not eat charset changes

Asked

Viewed 1,006 times

1

Hello,

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

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

  • How are you doing this "change in coding"?

  • @Pedroabreu actually I didn’t make any changes, just opened the file I saved. And Atom itself loses the accented characters.

1 answer

1

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

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

Another possibility is that the conversion is only changing the file charset without converting the characters of the same, there will continue in the same, even if the file is with a different charset.

  • 1

    Hello Marcos, but it’s not GIT that’s changing. It’s Atom. Just open a file in ISO-8859-1 and save (even without changes). Texts with accents are disfigured. But look, I’m talking about the Atomeditor okay? Thanks for the help ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.