Allow alternate encodings when creating a file

Needed for Embark processing