fixed bug with non-ascii files