Proper --encoding support for EFS. Also fixes a bug with uninitialized data.