open (OUT, ">:encoding(UTF-8)", ">$outfile") || die "Unable to open $outfile for writing.";