fix encoding when reading file