Fix Git filename encoding problems on Windows

See http://stackoverflow.com/questions/5854967/git-msysgit-accents-utf-8-the-definitive-answers
and https://github.com/kblees/git/wiki

I ran the tests on Linux using LC_CTYPE=lt_LT.UTF-8 and
LC_CTYPE=en_US.ISO-8859-1.