fix fileformat and encoding