Help for this page
open(OUTTEMP, '>:utf8', "$outfile"); print OUTTEMP "some text" . encode_entities(öä) . "some text\n";