- Timestamp:
- 01/22/08 07:53:40 (10 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Encode-JP-Mobile/trunk/tools/softbank-scrape-autosjis.pl
r5105 r5231 6 6 use FindBin; 7 7 8 use Data::Dumper; 9 $Data::Dumper::Terse++; 10 8 11 # how to make 103-111-HTML_2.0.0.txt 9 12 # 1. get PDF from http://www2.developers.softbankmobile.co.jp/dp/tool_dl/download.php?docid=120&companyid= … … 12 15 13 16 my $pdf_text_file = shift or die "Usage: softbank-scrape-autosjis.pl 103-111-HTML_2.0.0.txt"; 14 my $ fh =file($pdf_text_file)->openr;17 my $pdf_fh =file($pdf_text_file)->openr; 15 18 16 19 my %map; 17 while (my $line = <$ fh>) {20 while (my $line = <$pdf_fh>) { 18 21 chomp $line; 22 next if $line !~ /^&#\d\d\d\d\d;\s*&#x/; 23 19 24 my @codes = split /\s+/, $line; 20 21 if ( @codes != 4 || $codes[0] =~ /^&#x/ ) { 22 next; 23 } 25 next if @codes != 4; 24 26 25 27 my $unicode = strip_entity_ref_mark($codes[1]); … … 28 30 $map{ $unicode } = $shiftjis; 29 31 } 32 close $pdf_fh; 30 33 34 print Dump(\%map); 31 35 32 33 my $table_file = "$FindBin::Bin/../dat/softbank-table.yaml";34 my $table = YAML::LoadFile($table_file);35 36 for my $emoji (@$table) {37 $emoji->{sjis_auto} = $map{ $emoji->{unicode} };38 }39 40 print Dump $table;41 36 42 37 sub strip_entity_ref_mark {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)