ensure encoding when parsing files