#perl open(my $INPUT, "<:encoding(UTF-16LE)", 'temp.xsd') or die "Failed to open the INPUT file as UTF-16LE\n$!\n"; open (my $OUTPUT, ">:crlf:utf8", 'output.dat') or die "Failed to open the OUTPUT file\n$!\n"; print $OUTPUT $_ while (<$INPUT>);