I had a similar problem with * .rc files for a C ++ project, and it was found that the best way to solve this is to use git smudge and clear the filters to store everything in the repository as utf-8 and then convert to utf-16 when write to the working directory.
Thus, all git performs functions such as diff, merges or something that will work on utf8 text without problems, but your working copy will have utf16, which will be happy for the visual studio.
To configure this, make sure you are using a version of git that has an available icon (the latest versions of msysgit do) and add the following to your ~ / .gitconfig file:
[filter "utf16"] clean = iconv -f utf-16le -t utf-8 smudge = iconv -f utf-8 -t utf-16le required
Then in the .gitattributes file add:
*.rc filter=utf16 resource.h filter=utf16
If you already have existing files in utf16 stored as binary files, you need to delete them from the repository and re-add.
git rm --cached <names-of-utf16-files> git commit -am "removed utf16 files" git add <names-of-utf16-files> git commit -am "added utf16 files as utf8"
And now everything should work.
Imron
source share