Welcome
ยินดีต้อนรับสู่บอร์ด <strong>jtdic</strong>

สำหรับผู้ใช้ท่านใดที่ต้องการลงทะเบียนก็คลิก<a href="/profile.php?mode=register">ที่นี่</a>ได้ครับ

แปะไว้กันลืม แปลงไฟล์ UTF8 ไป UTF16LE (Unicode)

ใช้งานโปรแกรมดิกบน PDA

Moderator: lordbsd

แปะไว้กันลืม แปลงไฟล์ UTF8 ไป UTF16LE (Unicode)

Postby lordbsd on Thu Jul 17, 2008 4:09 pm

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);
lordbsd
starter
 
Posts: 14
Joined: Tue Jun 17, 2008 4:30 pm

Postby lordbsd on Thu Jul 17, 2008 4:59 pm

แปลงไฟล์ของปุ้ย

Code: Select all
#!/usr/bin/perl
use File::BOM qw(defuse);

open($fp ,"<raw>:raw:encoding(UTF-16LE):crlf:via(File::BOM)", "pui_jtdic.csv";


# print ord("【");
$count = 0;
foreach (<fp>) {
   $line = $_;
   $line =~ s/\n//g;
   ($kanji, $yomi, $type, $thai) = split ("/",$line);

   $data = "\"$kanji\",\"$type $thai\",\"\",0,0,0,\"$yomi\"\n";

   print $out $data;
}
close($fp);
close($out);
lordbsd
starter
 
Posts: 14
Joined: Tue Jun 17, 2008 4:30 pm


Return to คุยเรื่องโปรแกรมสำหรับ PDA

Who is online

Users browsing this forum: No registered users and 0 guests