- Code: Select all
#!/usr/bin/perl
use File::BOM qw(defuse);
open($fp ,"<:utf8","J2_UNIC.txt");
open $out, ">:raw:encoding(UTF-16LE):crlf:via(File::BOM)", "JTDIC_PDIC.txt";
# print ord("【");
$count = 0;
foreach (<$fp>) {
$line = $_;
$line =~ s/\n//g;
($kanji, $yomi, $thai, $type) = split ("/",$line);
$data = "\"$kanji\",\"$type $thai\",\"\",0,0,0,\"$yomi\"\n";
print $out $data;
}
close($fp);
close($out);
