# wrong way to write utf16 open $fout, ">", $file or die; binmode $fout, ":encoding(utf16le)" or die; print $fout "abc\n123\n\n"; close $fout;