line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Jcode.pm,v 2.7 2008/05/10 18:15:19 dankogai Exp dankogai $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Jcode; |
6
|
12
|
|
|
12
|
|
290334
|
use 5.005; # fair ? |
|
12
|
|
|
|
|
41
|
|
|
12
|
|
|
|
|
668
|
|
7
|
11
|
|
|
11
|
|
59
|
use Carp; |
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
1144
|
|
8
|
11
|
|
|
11
|
|
55
|
use strict; |
|
11
|
|
|
|
|
93
|
|
|
11
|
|
|
|
|
547
|
|
9
|
11
|
|
|
11
|
|
59
|
use vars qw($RCSID $VERSION $DEBUG); |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
1731
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$RCSID = q$Id: Jcode.pm,v 2.7 2008/05/10 18:15:19 dankogai Exp dankogai $; |
12
|
|
|
|
|
|
|
$VERSION = do { my @r = (q$Revision: 2.7 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; |
13
|
|
|
|
|
|
|
$DEBUG = 0; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# we no longer use Exporter |
16
|
11
|
|
|
11
|
|
59
|
use vars qw($USE_ENCODE); |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
579
|
|
17
|
|
|
|
|
|
|
$USE_ENCODE = ($] >= 5.008001); |
18
|
|
|
|
|
|
|
|
19
|
11
|
|
|
11
|
|
55
|
use Exporter; |
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
1529
|
|
20
|
11
|
|
|
11
|
|
53
|
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
3320
|
|
21
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
22
|
|
|
|
|
|
|
@EXPORT = qw(jcode getcode); |
23
|
|
|
|
|
|
|
@EXPORT_OK = qw($RCSID $VERSION $DEBUG); |
24
|
|
|
|
|
|
|
%EXPORT_TAGS = ( all => [ @EXPORT, @EXPORT_OK ] ); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use overload |
27
|
23
|
|
|
23
|
|
1062
|
q("") => sub { $_[0]->euc }, |
28
|
0
|
|
|
0
|
|
0
|
q(==) => sub { overload::StrVal($_[0]) eq overload::StrVal($_[1]) }, |
29
|
25
|
|
|
25
|
|
909
|
q(.=) => sub { $_[0]->append( $_[1] ) }, |
30
|
11
|
|
|
|
|
138
|
fallback => 1, |
31
|
11
|
|
|
11
|
|
23702
|
; |
|
11
|
|
|
|
|
15306
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
if ($USE_ENCODE){ |
34
|
|
|
|
|
|
|
$DEBUG and warn "Using Encode"; |
35
|
|
|
|
|
|
|
my $data = join("", ); |
36
|
11
|
50
|
66
|
11
|
0
|
16899
|
eval $data; |
|
11
|
50
|
50
|
11
|
0
|
210658
|
|
|
11
|
50
|
66
|
11
|
0
|
1103
|
|
|
11
|
50
|
33
|
11
|
1
|
96
|
|
|
11
|
50
|
33
|
11
|
1
|
25
|
|
|
11
|
50
|
66
|
11
|
1
|
598
|
|
|
11
|
100
|
66
|
11
|
1
|
14417
|
|
|
11
|
0
|
33
|
11
|
1
|
76685
|
|
|
11
|
50
|
50
|
11
|
1
|
78
|
|
|
11
|
100
|
100
|
11
|
1
|
13678
|
|
|
11
|
100
|
66
|
11
|
1
|
42206
|
|
|
11
|
50
|
100
|
1
|
1
|
410
|
|
|
11
|
50
|
50
|
0
|
1
|
98
|
|
|
11
|
100
|
50
|
1
|
1
|
21
|
|
|
11
|
50
|
50
|
1
|
1
|
20983
|
|
|
11
|
50
|
66
|
1
|
1
|
87
|
|
|
11
|
100
|
66
|
17
|
1
|
24
|
|
|
11
|
50
|
100
|
8
|
1
|
2143
|
|
|
11
|
100
|
100
|
55
|
1
|
66
|
|
|
11
|
50
|
|
12
|
1
|
25
|
|
|
11
|
50
|
|
50
|
|
3551
|
|
|
11
|
50
|
|
83
|
|
63
|
|
|
11
|
100
|
|
3
|
|
20
|
|
|
11
|
100
|
|
92
|
|
31111
|
|
|
11
|
0
|
|
8
|
|
90
|
|
|
11
|
100
|
|
136
|
|
22
|
|
|
11
|
50
|
|
6
|
|
518
|
|
|
11
|
50
|
|
5
|
|
13506
|
|
|
11
|
50
|
|
3
|
|
396
|
|
|
11
|
100
|
|
12
|
|
65
|
|
|
11
|
50
|
|
12
|
|
3490
|
|
|
11
|
50
|
|
184
|
|
23
|
|
|
11
|
50
|
|
5
|
|
46
|
|
|
1
|
100
|
|
206
|
|
42
|
|
|
1
|
100
|
|
10
|
|
3
|
|
|
1
|
100
|
|
71
|
|
5
|
|
|
1
|
100
|
|
2
|
|
2
|
|
|
1
|
100
|
|
|
|
7
|
|
|
1
|
50
|
|
|
|
5
|
|
|
1
|
50
|
|
|
|
6
|
|
|
1
|
100
|
|
|
|
7375
|
|
|
1
|
50
|
|
|
|
9
|
|
|
1
|
100
|
|
|
|
6
|
|
|
1
|
100
|
|
|
|
1
|
|
|
1
|
100
|
|
|
|
70
|
|
|
1
|
100
|
|
|
|
23
|
|
|
1
|
50
|
|
|
|
6
|
|
|
0
|
50
|
|
|
|
0
|
|
|
1
|
100
|
|
|
|
10
|
|
|
1
|
50
|
|
|
|
9
|
|
|
1
|
100
|
|
|
|
6
|
|
|
17
|
50
|
|
|
|
40
|
|
|
130
|
100
|
|
|
|
3074
|
|
|
113
|
50
|
|
|
|
19252
|
|
|
8
|
50
|
|
|
|
36
|
|
|
8
|
50
|
|
|
|
12
|
|
|
8
|
100
|
|
|
|
10
|
|
|
8
|
100
|
|
|
|
18
|
|
|
12
|
100
|
|
|
|
42
|
|
|
12
|
100
|
|
|
|
15
|
|
|
12
|
50
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
|
|
|
|
271
|
|
|
50
|
|
|
|
|
76982
|
|
|
50
|
|
|
|
|
1385
|
|
|
50
|
|
|
|
|
139
|
|
|
50
|
|
|
|
|
113
|
|
|
50
|
|
|
|
|
244
|
|
|
83
|
|
|
|
|
1038
|
|
|
83
|
|
|
|
|
210
|
|
|
83
|
|
|
|
|
1202
|
|
|
83
|
|
|
|
|
270
|
|
|
83
|
|
|
|
|
213
|
|
|
83
|
|
|
|
|
258
|
|
|
83
|
|
|
|
|
229
|
|
|
83
|
|
|
|
|
148
|
|
|
0
|
|
|
|
|
0
|
|
|
83
|
|
|
|
|
297
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
79
|
|
|
82
|
|
|
|
|
310
|
|
|
82
|
|
|
|
|
318692
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
11
|
|
|
92
|
|
|
|
|
3883
|
|
|
92
|
|
|
|
|
225
|
|
|
92
|
|
|
|
|
342
|
|
|
90
|
|
|
|
|
203
|
|
|
90
|
|
|
|
|
4989
|
|
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
6648
|
|
|
7
|
|
|
|
|
25
|
|
|
7
|
|
|
|
|
22
|
|
|
0
|
|
|
|
|
0
|
|
|
21
|
|
|
|
|
37
|
|
|
7
|
|
|
|
|
22
|
|
|
55
|
|
|
|
|
76801
|
|
|
55
|
|
|
|
|
141043
|
|
|
55
|
|
|
|
|
99023
|
|
|
55
|
|
|
|
|
274
|
|
|
55
|
|
|
|
|
222
|
|
|
55
|
|
|
|
|
482
|
|
|
90
|
|
|
|
|
603
|
|
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
19
|
|
|
8
|
|
|
|
|
31
|
|
|
8
|
|
|
|
|
562
|
|
|
8
|
|
|
|
|
24
|
|
|
136
|
|
|
|
|
12352
|
|
|
6
|
|
|
|
|
9
|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|
12
|
|
|
|
|
38
|
|
|
12
|
|
|
|
|
49
|
|
|
12
|
|
|
|
|
25
|
|
|
12
|
|
|
|
|
40
|
|
|
12
|
|
|
|
|
34
|
|
|
184
|
|
|
|
|
72630
|
|
|
184
|
|
|
|
|
351
|
|
|
184
|
|
|
|
|
396
|
|
|
184
|
|
|
|
|
497
|
|
|
184
|
|
|
|
|
533
|
|
|
5
|
|
|
|
|
693
|
|
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
24
|
|
|
5
|
|
|
|
|
215
|
|
|
5
|
|
|
|
|
197
|
|
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
343
|
|
|
5
|
|
|
|
|
23
|
|
|
2
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
12
|
|
|
206
|
|
|
|
|
263
|
|
|
206
|
|
|
|
|
290
|
|
|
206
|
|
|
|
|
476
|
|
|
206
|
|
|
|
|
1049
|
|
|
206
|
|
|
|
|
605
|
|
|
206
|
|
|
|
|
1535
|
|
|
206
|
|
|
|
|
1192
|
|
|
196
|
|
|
|
|
814
|
|
|
206
|
|
|
|
|
184472
|
|
|
206
|
|
|
|
|
377
|
|
|
206
|
|
|
|
|
354
|
|
|
206
|
|
|
|
|
336
|
|
|
206
|
|
|
|
|
1004
|
|
|
10
|
|
|
|
|
76
|
|
|
10
|
|
|
|
|
11
|
|
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
45
|
|
|
10
|
|
|
|
|
395
|
|
|
10
|
|
|
|
|
371
|
|
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
17
|
|
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
545
|
|
|
10
|
|
|
|
|
85
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
3
|
|
|
9
|
|
|
|
|
67
|
|
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
32
|
|
|
71
|
|
|
|
|
2101
|
|
|
71
|
|
|
|
|
337
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
870
|
|
|
2
|
|
|
|
|
8
|
|
37
|
|
|
|
|
|
|
$@ and die $@; |
38
|
|
|
|
|
|
|
}else{ |
39
|
|
|
|
|
|
|
$DEBUG and warn "Not Using Encode"; |
40
|
|
|
|
|
|
|
require Jcode::_Classic; |
41
|
11
|
|
|
11
|
|
1834
|
use vars qw/@ISA/; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
767
|
|
42
|
|
|
|
|
|
|
unshift @ISA, qw/Jcode::_Classic/; |
43
|
|
|
|
|
|
|
for my $sub (qw/jcode getcode convert load_module/){ |
44
|
11
|
|
|
11
|
|
156
|
no strict 'refs'; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
940
|
|
45
|
|
|
|
|
|
|
*{$sub} = \&{'Jcode::_Classic::' . $sub }; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
for my $enc (qw/sjis jis ucs2 utf8/){ |
48
|
11
|
|
|
11
|
|
52
|
no strict 'refs'; |
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
1285
|
|
49
|
|
|
|
|
|
|
*{"euc_" . $enc} = \&{"Jcode::_Classic::" . "euc_" . $enc}; |
50
|
|
|
|
|
|
|
*{$enc . "_euc"} = \&{"Jcode::_Classic::" . $enc . "_euc"}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
__DATA__ |