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 |
} |