set encoding on file open