To retroactively recode a file, use git filter-branch
:
git filter-branch --tree-filter 'recode utf-16..utf-8 file'
If you don't have recode
, use the longer iconv -f utf-16 -t utf-8 file -o file
instead. If the file doesn't exist in earlier versions of the tree, you need probably want to append || true
so the recoding command doesn't fail, and optionally suppress error output.