fix #196 pre-commit hook improvements for UTF-8 / binary files
fix #196 pre-commit hook improvements for UTF-8 / binary files

The previous commit ed322f3e52a7333fe5b30b2718d26d426a173b32 fixed a problem for UTF-8 files but introduced
new issues -- for the files having no trailing newline and for binary
files. This commit addresses all those problems.

Close #249.

vcarle/ariatemplates,fcapa/aria,fcapa/aria,fcapa/aria,divdavem/ariatemplates,lsimone/ariatemplates,mlaval/ariatemplates,simonarbuckle/ariatemplates,ymeine/ariatemplates,fbasso/ariatemplates,fbasso/ariatemplates,fbasso/ariatemplates,ymeine/ariatemplates,divdavem/ariatemplates,ariatemplates/ariatemplates,ariatemplates/ariatemplates,benouat/ariatemplates,benouat/ariatemplates,vcarle/ariatemplates,mlaval/ariatemplates,ymeine/ariatemplates,ariatemplates/ariatemplates,flongo/ariatemplates,benouat/ariatemplates,vcarle/ariatemplates,divdavem/ariatemplates,mlaval/ariatemplates,lsimone/ariatemplates,simonarbuckle/ariatemplates,simonarbuckle/ariatemplates