change character encoding and handling of temp file