my ($fh, $tempfile) = tempfile(); binmode( $fh, ":encoding(UTF-8)" );