Hi Denis,
Git uses the iconv library to convert files. And this issue is a result of iconv conversion:
echo “EFBBBF”| xxd -r -p | iconv -f utf-8 -t ibm-1147 > f_1147
od -h f_1147
You can see that f_1147 file has the x3F character. Iconv replaces all characters, which don’t have corresponding characters in the destination encoding, with the substitute character. On Git side there is no way to modify the iconv behavior. You shouldn’t use in the UTF-8 files characters, that don’t exist in the destination character set.