/[pub]/suikawiki/wikidata/migration/test3.pl
Suika

Contents of /suikawiki/wikidata/migration/test3.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue May 4 00:56:31 2010 UTC (14 years, 6 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
added to the repository

1 use strict;
2 require Encode::EUCJPSW;
3
4 $|=1;
5
6 while (<>) {
7 my $file_name = $_;
8 $file_name =~ tr/\x0d\x0a//d;
9 warn $file_name . "...\n";
10 open my $file, '<', $file_name;
11 local $/ = undef;
12 my $c = <$file>;
13
14 $c =~ s/[\x00-\x7f][\xa0-\xff][\x00-\x7f]//g;
15 my $errr = 0;
16 print "ERR: $file_name\n";
17
18 $file_name =~ s/([0-9A-Fa-f]{2})/pack 'C', hex $1/ge;
19
20 print "($file_name)\n";
21
22 Encode::decode ('euc-jp-sw', $c,
23 sub{
24 printf "# %02X\n", $_[0];
25 $errr=1;
26 }
27 );
28
29
30 }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24