Specify encoding as utf-8 when opening files to fix #4