Thread From : UTF-16LE => To : UTF8 (15 answers)
Opened by etsej at 2011-03-21 16:39

kristian
 2011-03-22 13:51
#146774 #146774
User since
2005-04-14
684 Artikel
BenutzerIn
[Homepage] [default_avatar]
Seltsam, seltsam...

Versuch es mal damit:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
use strict;
use warnings;
use Encode;

my $from     = $ARGV[0];
my $to       = $ARGV[1];
my $in_file  = $ARGV[2];
my $out_file = $ARGV[3];

open my $input, "<:encoding($from)", $in_file or die "$!";
open my $output, ">:encoding($to)", $out_file or die "$!";

while(<$input>){
    print $output $_;
}

close($input);
close($output);


./script.pl UTF-16LE utf8 in.txt out.txt

Wenn das nicht funktioniert legst du die Datei am besten mal gezippt irgendwo zum Download hin.

View full thread From : UTF-16LE => To : UTF8