Changeset 4838 for lang/perl/Encode-JP-Mobile/trunk/tools
- Timestamp:
- 01/18/08 10:28:13 (10 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Encode-JP-Mobile/trunk/tools/kddi-extract.pl
r1378 r4838 3 3 use warnings; 4 4 use Encode; 5 use Encode::JP::Mobile; 5 6 use CAM::PDF; 7 8 # scraping from http://www.au.kddi.com/ezfactory/tec/spec/pdf/typeD.pdf 6 9 7 10 my $file = shift or die "Usage: kddi-extract.pl typeD.pdf\n"; … … 9 12 10 13 my @res; 11 for eachmy $p (1..$doc->numPages()) {14 for my $p (1..$doc->numPages()) { 12 15 my $text = decode("shift_jis", $doc->getPageText($p)); 13 16 while ($text =~ m/(\d+)(?: |[abcdef \x{FF43}\x{3000}]+|\x{306A}\x{3057} )([^ ]*) ([0-9A-F]{4})([0-9A-F]{4})([0-9A-F]{4})([0-9A-F]{4})/gs) { … … 15 18 @data{qw( number name sjis unicode email_jis email_sjis )} = ($1, $2, $3, $4, $5, $6); 16 19 $data{name} =~ s/\n//g; 20 $data{unicode_auto} = sprintf '%X', ord decode 'x-sjis-kddi-auto', pack "H*", $data{sjis}; 17 21 push @res, \%data; 18 22 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)