encode file