line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Jcode::CP932; |
2
|
|
|
|
|
|
|
require 5.008001; |
3
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
4
|
|
|
|
|
|
|
|
5
|
13
|
|
|
13
|
|
196189
|
use warnings; |
|
13
|
|
|
|
|
22
|
|
|
13
|
|
|
|
|
465
|
|
6
|
13
|
|
|
13
|
|
62
|
use strict; |
|
13
|
|
|
|
|
21
|
|
|
13
|
|
|
|
|
368
|
|
7
|
13
|
|
|
13
|
|
490
|
use Carp; |
|
13
|
|
|
|
|
33
|
|
|
13
|
|
|
|
|
1231
|
|
8
|
|
|
|
|
|
|
|
9
|
13
|
|
|
13
|
|
80
|
use base qw/Jcode/; |
|
13
|
|
|
|
|
23
|
|
|
13
|
|
|
|
|
13108
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw(jcode getcode); |
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw($VERSION $DEBUG); |
12
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => [ @EXPORT, @EXPORT_OK ] ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $DEBUG; |
15
|
|
|
|
|
|
|
our $FALLBACK; |
16
|
|
|
|
|
|
|
our $NORMALIZE; |
17
|
|
|
|
|
|
|
*DEBUG = \$Jcode::DEBUG; |
18
|
|
|
|
|
|
|
*FALLBACK = \$Jcode::FALLBACK; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$NORMALIZE = \&normalize_cp932; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use overload |
23
|
23
|
|
|
23
|
|
4584
|
q("") => sub { $_[0]->euc }, |
24
|
0
|
|
|
0
|
|
0
|
q(==) => sub { overload::StrVal($_[0]) eq overload::StrVal($_[1]) }, |
25
|
25
|
|
|
25
|
|
1145
|
q(.=) => sub { $_[0]->append( $_[1] ) }, |
26
|
13
|
|
|
|
|
180
|
fallback => 1, |
27
|
13
|
|
|
13
|
|
707064
|
; |
|
13
|
|
|
|
|
64
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $pkg = __PACKAGE__; |
30
|
13
|
|
|
13
|
|
1303
|
use Encode; |
|
13
|
|
|
|
|
30
|
|
|
13
|
|
|
|
|
1349
|
|
31
|
13
|
|
|
13
|
|
77
|
use Encode::Alias; |
|
13
|
|
|
|
|
25
|
|
|
13
|
|
|
|
|
623
|
|
32
|
13
|
|
|
13
|
|
74
|
use Encode::Guess; |
|
13
|
|
|
|
|
25
|
|
|
13
|
|
|
|
|
134
|
|
33
|
13
|
|
|
13
|
|
940
|
use Encode::JP::H2Z; |
|
13
|
|
|
|
|
26
|
|
|
13
|
|
|
|
|
275
|
|
34
|
13
|
|
|
13
|
|
183
|
use Scalar::Util; # to resolve from_to() vs. 'constant' issue. |
|
13
|
|
|
|
|
31
|
|
|
13
|
|
|
|
|
693
|
|
35
|
|
|
|
|
|
|
|
36
|
13
|
|
|
13
|
|
13119
|
use Encode::EUCJPMS; |
|
13
|
|
|
|
|
57801
|
|
|
13
|
|
|
|
|
3545
|
|
37
|
|
|
|
|
|
|
sub default_encode_mapping { |
38
|
13
|
|
|
13
|
0
|
150
|
sjis => 'cp932', |
39
|
|
|
|
|
|
|
euc => 'cp51932', |
40
|
|
|
|
|
|
|
jis => 'cp50221', |
41
|
|
|
|
|
|
|
iso_2022_jp => 'cp50220', |
42
|
|
|
|
|
|
|
ucs2 => 'UTF-16BE', |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$pkg->set_jname2e( default_encode_mapping() ); |
46
|
|
|
|
|
|
|
my %jname2e; |
47
|
|
|
|
|
|
|
my %ename2j; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub set_jname2e { |
50
|
14
|
|
|
14
|
0
|
1326
|
my $class = shift; |
51
|
14
|
|
|
|
|
79
|
my %new_jname2e = @_; |
52
|
14
|
|
|
|
|
67
|
foreach my $enc (keys %new_jname2e) { |
53
|
70
|
|
33
|
|
|
207
|
my $name = $new_jname2e{$enc} || $enc; |
54
|
70
|
50
|
|
|
|
230
|
my $e = find_encoding($name) or croak "$enc not supported"; |
55
|
|
|
|
|
|
|
|
56
|
70
|
|
|
|
|
1075
|
$jname2e{$enc} = $name; |
57
|
70
|
|
|
|
|
128
|
$ename2j{$name} = $enc; |
58
|
|
|
|
|
|
|
|
59
|
13
|
|
|
13
|
|
3661
|
no strict 'refs'; |
|
13
|
|
|
|
|
33
|
|
|
13
|
|
|
|
|
483
|
|
60
|
13
|
|
|
13
|
|
77
|
no warnings 'redefine'; |
|
13
|
|
|
|
|
40
|
|
|
13
|
|
|
|
|
5160
|
|
61
|
70
|
|
|
|
|
395
|
*{"$class\::$enc"} = sub { |
62
|
120
|
|
|
120
|
|
7707
|
my $r_str = $_[0]->{r_str}; |
63
|
120
|
50
|
|
|
|
3640
|
$_[0]->{normalize} and $_[0]->{normalize}->( $r_str ); |
64
|
120
|
50
|
|
|
|
48390
|
Encode::is_utf8($$r_str) ? $e->encode($$r_str, $_[0]->{fallback}) |
65
|
|
|
|
|
|
|
: $$r_str; |
66
|
70
|
|
|
|
|
285
|
}; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub jcode { |
71
|
110
|
|
|
110
|
1
|
35730
|
$pkg->new(@_) |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub new { |
75
|
190
|
|
|
190
|
1
|
145318
|
my $class = shift; |
76
|
190
|
|
|
|
|
7105
|
my $self = $class->SUPER::new( @_ ); |
77
|
190
|
|
|
|
|
525
|
$self->{normalize} = $NORMALIZE; |
78
|
190
|
|
|
|
|
2171
|
$self; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
## from original Jcode |
82
|
|
|
|
|
|
|
my %_0208 = ( |
83
|
|
|
|
|
|
|
1978 => '\e\$\@', |
84
|
|
|
|
|
|
|
1983 => '\e\$B', |
85
|
|
|
|
|
|
|
1990 => '\e&\@\e\$B', |
86
|
|
|
|
|
|
|
); |
87
|
|
|
|
|
|
|
my %RE = ( |
88
|
|
|
|
|
|
|
ASCII => '[\x00-\x7f]', |
89
|
|
|
|
|
|
|
BIN => '[\x00-\x06\x7f\xff]', |
90
|
|
|
|
|
|
|
EUC_0212 => '\x8f[\xa1-\xfe][\xa1-\xfe]', |
91
|
|
|
|
|
|
|
EUC_C => '[\xa1-\xfe][\xa1-\xfe]', |
92
|
|
|
|
|
|
|
EUC_KANA => '\x8e[\xa1-\xdf]', |
93
|
|
|
|
|
|
|
JIS_0208 => "$_0208{1978}|$_0208{1983}|$_0208{1990}", |
94
|
|
|
|
|
|
|
JIS_0212 => "\e" . '\$\(D', |
95
|
|
|
|
|
|
|
JIS_ASC => "\e" . '\([BJ]', |
96
|
|
|
|
|
|
|
JIS_KANA => "\e" . '\(I', |
97
|
|
|
|
|
|
|
SJIS_C => '[\x81-\x9f\xe0-\xfc][\x40-\x7e\x80-\xfc]', |
98
|
|
|
|
|
|
|
SJIS_KANA => '[\xa1-\xdf]', |
99
|
|
|
|
|
|
|
UTF8 => '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]' |
100
|
|
|
|
|
|
|
); |
101
|
|
|
|
|
|
|
|
102
|
13
|
|
|
13
|
|
191
|
use B::Deparse; |
|
13
|
|
|
|
|
30
|
|
|
13
|
|
|
|
|
5931
|
|
103
|
|
|
|
|
|
|
my $deparse = B::Deparse->new(); |
104
|
|
|
|
|
|
|
$deparse->ambient_pragmas(strict => 'all'); |
105
|
|
|
|
|
|
|
foreach my $func (qw/convert append getcode set _max/) { |
106
|
|
|
|
|
|
|
my $body = $deparse->coderef2text( \&{"Jcode::$func"} ); |
107
|
0
|
0
|
50
|
0
|
1
|
0
|
eval "sub $func $body"; |
|
0
|
50
|
66
|
50
|
1
|
0
|
|
|
0
|
100
|
33
|
51
|
1
|
0
|
|
|
0
|
50
|
33
|
5
|
1
|
0
|
|
|
50
|
100
|
66
|
202
|
|
82
|
|
|
50
|
50
|
66
|
|
|
120
|
|
|
50
|
50
|
33
|
|
|
153
|
|
|
50
|
50
|
50
|
|
|
260
|
|
|
50
|
100
|
66
|
|
|
687
|
|
|
50
|
100
|
66
|
|
|
205670
|
|
|
50
|
0
|
|
|
|
333
|
|
|
50
|
100
|
|
|
|
204
|
|
|
50
|
50
|
|
|
|
71634
|
|
|
50
|
50
|
|
|
|
13616
|
|
|
50
|
50
|
|
|
|
127
|
|
|
50
|
50
|
|
|
|
126
|
|
|
50
|
50
|
|
|
|
234
|
|
|
51
|
50
|
|
|
|
901
|
|
|
51
|
100
|
|
|
|
137
|
|
|
51
|
100
|
|
|
|
226
|
|
|
51
|
100
|
|
|
|
148
|
|
|
51
|
50
|
|
|
|
130
|
|
|
51
|
100
|
|
|
|
162
|
|
|
51
|
50
|
|
|
|
148
|
|
|
51
|
100
|
|
|
|
94
|
|
|
0
|
100
|
|
|
|
0
|
|
|
51
|
100
|
|
|
|
176
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
71
|
|
|
50
|
|
|
|
|
170
|
|
|
50
|
|
|
|
|
166136
|
|
|
5
|
|
|
|
|
1914
|
|
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
31
|
|
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
673
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
865
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
9430
|
|
|
3
|
|
|
|
|
17506
|
|
|
3
|
|
|
|
|
11425
|
|
|
3
|
|
|
|
|
127
|
|
|
3
|
|
|
|
|
120
|
|
|
3
|
|
|
|
|
43
|
|
|
5
|
|
|
|
|
27
|
|
|
202
|
|
|
|
|
14744
|
|
|
202
|
|
|
|
|
415
|
|
|
202
|
|
|
|
|
734
|
|
|
202
|
|
|
|
|
810
|
|
|
202
|
|
|
|
|
1998
|
|
|
202
|
|
|
|
|
11547
|
|
|
202
|
|
|
|
|
1499
|
|
|
194
|
|
|
|
|
887
|
|
|
202
|
|
|
|
|
226420
|
|
|
202
|
|
|
|
|
714
|
|
|
202
|
|
|
|
|
478
|
|
|
202
|
|
|
|
|
432
|
|
|
202
|
|
|
|
|
790
|
|
108
|
|
|
|
|
|
|
die if $@; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
## |
112
|
|
|
|
|
|
|
sub utf8 { |
113
|
77
|
|
|
77
|
1
|
1723
|
my $str_ref = $_[0]->{r_str}; |
114
|
77
|
50
|
|
|
|
2659
|
$_[0]->{normalize} and $_[0]->{normalize}->( $str_ref ); |
115
|
77
|
|
|
|
|
349
|
encode_utf8( $$str_ref ) |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub get { |
119
|
0
|
|
|
0
|
1
|
0
|
${$_[0]->{r_str}}; |
|
0
|
|
|
|
|
0
|
|
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
## Normalize |
124
|
|
|
|
|
|
|
sub normalize { |
125
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
126
|
0
|
0
|
|
|
|
0
|
@_ or return $self->{normalize}; |
127
|
0
|
|
|
|
|
0
|
$self->{normalize} = $_[0]; |
128
|
0
|
|
|
|
|
0
|
return $self; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
my %jis_cp932; |
132
|
|
|
|
|
|
|
my $j2c_jis; |
133
|
|
|
|
|
|
|
my $j2c_cp932; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
# YEN SIGN, EM DASH, OVERLINE, MIDLINE HORIZONTAL ELLIPSIS
|
136
|
|
|
|
|
|
|
my $other_mapping = "\x{00A5}\x{2014}\x{203E}\x{22EF}"; |
137
|
|
|
|
|
|
|
# REVERSE SOLIDUS, HORIZONTAL BAR, FULLWIDTH MACRON, HORIZONTAL ELLIPSIS
|
138
|
|
|
|
|
|
|
my $jis_mapping = "\x{005C}\x{2015}\x{FFE3}\x{2026}";
|
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub set_jis_cp932 { |
141
|
13
|
|
|
13
|
0
|
43
|
my $class = shift; |
142
|
13
|
|
|
|
|
141
|
%jis_cp932 = @_; |
143
|
|
|
|
|
|
|
|
144
|
13
|
|
|
|
|
90
|
$j2c_jis = join '', keys %jis_cp932; |
145
|
13
|
|
|
|
|
61
|
$j2c_cp932 = join '', values %jis_cp932; |
146
|
|
|
|
|
|
|
|
147
|
13
|
|
|
|
|
64
|
$j2c_jis =~ s,\\,\\\\,og; $j2c_jis =~ s,/,\\/,og; |
|
13
|
|
|
|
|
45
|
|
148
|
13
|
|
|
|
|
43
|
$j2c_cp932 =~ s,\\,\\\\,og; $j2c_cp932 =~ s,/,\\/,og; |
|
13
|
|
|
|
|
45
|
|
149
|
|
|
|
|
|
|
|
150
|
13
|
|
|
13
|
|
83
|
no strict 'refs'; |
|
13
|
|
|
|
|
25
|
|
|
13
|
|
|
|
|
382
|
|
151
|
13
|
|
|
13
|
|
61
|
no warnings 'redefine'; |
|
13
|
|
|
|
|
43
|
|
|
13
|
|
|
|
|
3494
|
|
152
|
13
|
50
|
33
|
172
|
|
1519
|
*{"$class\::normalize_cp932"} = eval qq{ |
|
13
|
50
|
|
|
|
90
|
|
|
172
|
|
|
|
|
696
|
|
|
172
|
|
|
|
|
1119
|
|
|
172
|
|
|
|
|
199690
|
|
|
172
|
|
|
|
|
604
|
|
153
|
|
|
|
|
|
|
sub { |
154
|
|
|
|
|
|
|
my \$str_ref = ref \$_[0]? \$_[0]: \\\$_[0]; |
155
|
|
|
|
|
|
|
if (defined \$\$str_ref and Encode::is_utf8(\$\$str_ref)) { |
156
|
|
|
|
|
|
|
\$\$str_ref =~ tr/$j2c_jis$other_mapping/$j2c_cp932$jis_mapping/; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
\$\$str_ref; |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
}; |
161
|
13
|
50
|
|
|
|
69
|
die $@ if $@; |
162
|
|
|
|
|
|
|
|
163
|
13
|
50
|
33
|
25
|
|
1233
|
*{"$class\::normalize_jis"} = eval qq{ |
|
13
|
50
|
|
|
|
96
|
|
|
25
|
|
|
|
|
102
|
|
|
25
|
|
|
|
|
193
|
|
|
25
|
|
|
|
|
32983
|
|
|
25
|
|
|
|
|
97
|
|
164
|
|
|
|
|
|
|
sub { |
165
|
|
|
|
|
|
|
my \$str_ref = ref \$_[0]? \$_[0]: \\\$_[0]; |
166
|
|
|
|
|
|
|
if (defined \$\$str_ref and Encode::is_utf8(\$\$str_ref)) { |
167
|
|
|
|
|
|
|
\$\$str_ref =~ tr/$j2c_cp932$other_mapping/$j2c_jis$jis_mapping/; |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
\$\$str_ref; |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
}; |
172
|
13
|
50
|
|
|
|
73
|
die $@ if $@; |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
# JIS => CP932 |
175
|
|
|
|
|
|
|
$pkg->set_jis_cp932( |
176
|
|
|
|
|
|
|
"\x{2016}" => "\x{2225}", # DOBULE VERTICAL LINE => PARALLEL TO |
177
|
|
|
|
|
|
|
"\x{2212}" => "\x{FF0D}", # MINUS SIGN => FULLWIDTH HYPHEN-MINUS |
178
|
|
|
|
|
|
|
"\x{301C}" => "\x{FF5E}", # WAVE DASH => FULLWIDTH TILDE |
179
|
|
|
|
|
|
|
"\x{00A2}" => "\x{FFE0}", # CENT SIGN => FULLWIDTH CENT SIGN |
180
|
|
|
|
|
|
|
"\x{00A3}" => "\x{FFE1}", # POUND SIGN => FULLWIDTH POUND SIGN |
181
|
|
|
|
|
|
|
"\x{00AC}" => "\x{FFE2}", # NOT SIGN => FULLWIDTH NOT SIGN |
182
|
|
|
|
|
|
|
"\x{00A6}" => "\x{FFE4}", # BROKEN BAR => FULLWIDTH BROKEN BAR |
183
|
|
|
|
|
|
|
); |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
####################################### |
188
|
|
|
|
|
|
|
# Full and Half |
189
|
|
|
|
|
|
|
####################################### |
190
|
|
|
|
|
|
|
|
191
|
13
|
|
|
13
|
|
9525
|
use Jcode::CP932::H2Z; |
|
13
|
|
|
|
|
38
|
|
|
13
|
|
|
|
|
2988
|
|
192
|
|
|
|
|
|
|
sub h2z { |
193
|
10
|
|
|
10
|
1
|
14
|
my $self = shift; |
194
|
10
|
|
|
|
|
39
|
Jcode::CP932::H2Z::h2z( $self->{r_str}, @_ ); |
195
|
10
|
|
|
|
|
34
|
$self; |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub z2h { |
199
|
4
|
|
|
4
|
1
|
9
|
my $self = shift; |
200
|
4
|
|
|
|
|
15
|
Jcode::CP932::H2Z::z2h( $self->{r_str}, @_ ); |
201
|
4
|
|
|
|
|
14
|
$self; |
202
|
|
|
|
|
|
|
} |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub h2z_ascii { |
205
|
2
|
|
|
2
|
0
|
5
|
my $str_ref = $_[0]->{r_str}; |
206
|
2
|
|
|
|
|
168
|
$$str_ref =~ tr |
207
|
|
|
|
|
|
|
[\x{0020}\x{0021}\x{0022}\x{0023}-\x{0026}\x{0027}\x{0028}-\x{005f}\x{0060}\x{0061}-\x{007e}\x{00a5}\x{00a6}] |
208
|
13
|
|
|
13
|
|
76
|
[\x{3000}\x{ff01}\x{201d}\x{ff03}-\x{ff06}\x{2019}\x{ff08}-\x{ff3f}\x{2018}\x{ff41}-\x{ff5e}\x{ffe5}\x{ffe4}] |
|
13
|
|
|
|
|
25
|
|
|
13
|
|
|
|
|
215
|
|
209
|
|
|
|
|
|
|
; |
210
|
2
|
|
|
|
|
9
|
$_[0]; |
211
|
|
|
|
|
|
|
} |
212
|
|
|
|
|
|
|
sub z2h_ascii { |
213
|
2
|
|
|
2
|
0
|
7
|
my $str_ref = $_[0]->{r_str}; |
214
|
2
|
|
|
|
|
70
|
$$str_ref =~ tr |
215
|
|
|
|
|
|
|
[\x{3000}\x{ff01}-\x{ff5e}\x{ffe5}\x{ffe4}\x{201d}\x{2019}\x{2018}] |
216
|
|
|
|
|
|
|
[\x{0020}\x{0021}-\x{007e}\x{00a5}\x{00a6}\x{0022}\x{0027}\x{0060}] |
217
|
|
|
|
|
|
|
; |
218
|
2
|
|
|
|
|
6
|
$_[0]; |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
sub h2z_all { |
222
|
2
|
|
|
2
|
0
|
4
|
my $self = shift; |
223
|
2
|
|
|
|
|
5
|
$self->h2z(@_)->h2z_ascii; |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
sub z2h_all { |
226
|
2
|
|
|
2
|
0
|
6
|
my $self = shift; |
227
|
2
|
|
|
|
|
5
|
$self->z2h(@_)->z2h_ascii; |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
####################################### |
231
|
|
|
|
|
|
|
# Hiragana and Katakana |
232
|
|
|
|
|
|
|
####################################### |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
sub hira2kata { |
235
|
2
|
|
|
2
|
0
|
6
|
my $str_ref = $_[0]->{r_str}; |
236
|
2
|
|
|
|
|
53
|
$$str_ref =~ tr [\x{3041}-\x{3096}] |
237
|
|
|
|
|
|
|
[\x{30a1}-\x{30f6}] ; |
238
|
2
|
|
|
|
|
9
|
$_[0]; |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
sub kata2hira { |
241
|
2
|
|
|
2
|
0
|
6
|
my $str_ref = $_[0]->{r_str}; |
242
|
2
|
|
|
|
|
47
|
$$str_ref =~ tr [\x{30a1}-\x{30f6}] |
243
|
|
|
|
|
|
|
[\x{3041}-\x{3096}] ; |
244
|
2
|
|
|
|
|
9
|
$_[0]; |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
1; # End of Jcode::CP932 |
250
|
|
|
|
|
|
|
__END__ |