set proper encoding for temporary file