Fix errors with files containing unicode characters