line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#-*- perl -*- |
2
|
|
|
|
|
|
|
#-*- coding: utf-8 -*- |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Encode::JISX0213; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1112
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
7
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
8
|
1
|
|
|
1
|
|
20
|
use base qw(Encode::ISO2022); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
677
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5703
|
use Encode::ISOIRSingle; |
|
1
|
|
|
|
|
1023
|
|
|
1
|
|
|
|
|
57
|
|
12
|
1
|
|
|
1
|
|
619
|
use Encode::JISLegacy; |
|
1
|
|
|
|
|
11693
|
|
|
1
|
|
|
|
|
62
|
|
13
|
1
|
|
|
1
|
|
828
|
use Encode::JISX0213::CCS; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1226
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
__PACKAGE__->Define( |
16
|
|
|
|
|
|
|
Alias => qr/\beuc-?(jis|jp)-?2004$/i, |
17
|
|
|
|
|
|
|
Name => 'euc-jis-2004', |
18
|
|
|
|
|
|
|
CCS => [ |
19
|
|
|
|
|
|
|
{ cl => 1, |
20
|
|
|
|
|
|
|
encoding => 'ascii', |
21
|
|
|
|
|
|
|
g_init => 'g0', |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
{encoding => 'c1-ctrl',}, |
24
|
|
|
|
|
|
|
{ bytes => 2, |
25
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-ascii', |
26
|
|
|
|
|
|
|
gr => 1, |
27
|
|
|
|
|
|
|
g_init => 'g1', |
28
|
|
|
|
|
|
|
range => '\xA1-\xFE', |
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
{ bytes => 2, |
31
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane2', |
32
|
|
|
|
|
|
|
gr => 1, |
33
|
|
|
|
|
|
|
g_init => 'g3', |
34
|
|
|
|
|
|
|
ss => "\x8F", |
35
|
|
|
|
|
|
|
range => '\xA1-\xFE', |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Unrecommended encodings |
39
|
|
|
|
|
|
|
{ encoding => 'jis-x-0201-right', |
40
|
|
|
|
|
|
|
gr => 1, |
41
|
|
|
|
|
|
|
g_init => 'g2', |
42
|
|
|
|
|
|
|
ss => "\x8E", |
43
|
|
|
|
|
|
|
}, |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Nonstandard |
46
|
|
|
|
|
|
|
{ bytes => 2, |
47
|
|
|
|
|
|
|
encoding => 'jis-x-0212-ascii', |
48
|
|
|
|
|
|
|
gr => 1, |
49
|
|
|
|
|
|
|
g_init => 'g3', |
50
|
|
|
|
|
|
|
ss => "\x8F", |
51
|
|
|
|
|
|
|
range => '\xA1-\xFE', |
52
|
|
|
|
|
|
|
}, |
53
|
|
|
|
|
|
|
], |
54
|
|
|
|
|
|
|
SubChar => "\x{3013}", |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Encode::define_alias(qr/\beucjisx0213$/i => '"euc-jisx0213"'); |
58
|
|
|
|
|
|
|
Encode::define_alias(qr/\beuc.*jp[ \-]?(?:2000|2k)$/i => '"euc-jisx0213"'); |
59
|
|
|
|
|
|
|
Encode::define_alias(qr/\bjp.*euc[ \-]?(2000|2k)$/i => '"euc-jisx0213"'); |
60
|
|
|
|
|
|
|
Encode::define_alias(qr/\bujis[ \-]?(?:2000|2k)$/i => '"euc-jisx0213"'); |
61
|
|
|
|
|
|
|
__PACKAGE__->Define( |
62
|
|
|
|
|
|
|
Name => 'euc-jisx0213', |
63
|
|
|
|
|
|
|
CCS => [ |
64
|
|
|
|
|
|
|
{ cl => 1, |
65
|
|
|
|
|
|
|
encoding => 'ascii', |
66
|
|
|
|
|
|
|
g_init => 'g0', |
67
|
|
|
|
|
|
|
}, |
68
|
|
|
|
|
|
|
{encoding => 'c1-ctrl',}, |
69
|
|
|
|
|
|
|
{ bytes => 2, |
70
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-2000-ascii', |
71
|
|
|
|
|
|
|
gr => 1, |
72
|
|
|
|
|
|
|
g_init => 'g1', |
73
|
|
|
|
|
|
|
range => '\xA1-\xFE', |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
{ bytes => 2, |
76
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane2', |
77
|
|
|
|
|
|
|
gr => 1, |
78
|
|
|
|
|
|
|
g_init => 'g3', |
79
|
|
|
|
|
|
|
ss => "\x8F", |
80
|
|
|
|
|
|
|
range => '\xA1-\xFE', |
81
|
|
|
|
|
|
|
}, |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Unrecommended encodings |
84
|
|
|
|
|
|
|
{ encoding => 'jis-x-0201-right', |
85
|
|
|
|
|
|
|
gr => 1, |
86
|
|
|
|
|
|
|
g_init => 'g2', |
87
|
|
|
|
|
|
|
ss => "\x8E", |
88
|
|
|
|
|
|
|
}, |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# Nonstandard |
91
|
|
|
|
|
|
|
{ bytes => 2, |
92
|
|
|
|
|
|
|
encoding => 'jis-x-0212-ascii', |
93
|
|
|
|
|
|
|
gr => 1, |
94
|
|
|
|
|
|
|
g_init => 'g3', |
95
|
|
|
|
|
|
|
ss => "\x8F", |
96
|
|
|
|
|
|
|
range => '\xA1-\xFE', |
97
|
|
|
|
|
|
|
}, |
98
|
|
|
|
|
|
|
], |
99
|
|
|
|
|
|
|
SubChar => "\x{3013}", |
100
|
|
|
|
|
|
|
); |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
__PACKAGE__->Define( |
103
|
|
|
|
|
|
|
Alias => qr/\biso-?2022-?jp-?2004$/i, |
104
|
|
|
|
|
|
|
Name => 'iso-2022-jp-2004', |
105
|
|
|
|
|
|
|
CCS => [ |
106
|
|
|
|
|
|
|
{ cl => 1, |
107
|
|
|
|
|
|
|
encoding => 'ascii', |
108
|
|
|
|
|
|
|
g_init => 'g0', |
109
|
|
|
|
|
|
|
g_seq => "\e\x28\x42", |
110
|
|
|
|
|
|
|
}, |
111
|
|
|
|
|
|
|
{ bytes => 2, |
112
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-ascii', |
113
|
|
|
|
|
|
|
g => 'g0', |
114
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x51", |
115
|
|
|
|
|
|
|
range => '\x21-\x7E', |
116
|
|
|
|
|
|
|
}, |
117
|
|
|
|
|
|
|
{ bytes => 2, |
118
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane2', |
119
|
|
|
|
|
|
|
g => 'g0', |
120
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x50", |
121
|
|
|
|
|
|
|
range => '\x21-\x7E', |
122
|
|
|
|
|
|
|
}, |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
# Unrecommended encodings. |
125
|
|
|
|
|
|
|
{ bytes => 2, |
126
|
|
|
|
|
|
|
dec_only => 1, |
127
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-2000-ascii', |
128
|
|
|
|
|
|
|
g => 'g0', |
129
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x4F", |
130
|
|
|
|
|
|
|
range => '\x21-\x7E', |
131
|
|
|
|
|
|
|
}, |
132
|
|
|
|
|
|
|
{ bytes => 2, |
133
|
|
|
|
|
|
|
encoding => 'jis-x-0208-ascii', |
134
|
|
|
|
|
|
|
g => 'g0', |
135
|
|
|
|
|
|
|
g_seq => "\e\x24\x42", |
136
|
|
|
|
|
|
|
ss => '', # encodes runs as short as possible |
137
|
|
|
|
|
|
|
range => '\x21-\x7E', |
138
|
|
|
|
|
|
|
}, |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
# Nonstandard |
141
|
|
|
|
|
|
|
], |
142
|
|
|
|
|
|
|
SubChar => "\x{3013}", |
143
|
|
|
|
|
|
|
); |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
__PACKAGE__->Define( |
146
|
|
|
|
|
|
|
Alias => qr/\biso-?2022-?jp-?2004-?strict$/i, |
147
|
|
|
|
|
|
|
Name => 'x-iso2022jp2004-strict', |
148
|
|
|
|
|
|
|
CCS => [ |
149
|
|
|
|
|
|
|
{ cl => 1, |
150
|
|
|
|
|
|
|
encoding => 'ascii', |
151
|
|
|
|
|
|
|
g_init => 'g0', |
152
|
|
|
|
|
|
|
g_seq => "\e\x28\x42", |
153
|
|
|
|
|
|
|
}, |
154
|
|
|
|
|
|
|
{ bytes => 2, |
155
|
|
|
|
|
|
|
encoding => 'jis-x-0208-0213-ascii', |
156
|
|
|
|
|
|
|
g => 'g0', |
157
|
|
|
|
|
|
|
g_seq => "\e\x24\x42", |
158
|
|
|
|
|
|
|
range => '\x21-\x7E', |
159
|
|
|
|
|
|
|
}, |
160
|
|
|
|
|
|
|
{ bytes => 2, |
161
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-ascii', |
162
|
|
|
|
|
|
|
g => 'g0', |
163
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x51", |
164
|
|
|
|
|
|
|
ss => '', # encodes runs as short as possible |
165
|
|
|
|
|
|
|
range => '\x21-\x7E', |
166
|
|
|
|
|
|
|
}, |
167
|
|
|
|
|
|
|
{ bytes => 2, |
168
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane2', |
169
|
|
|
|
|
|
|
g => 'g0', |
170
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x50", |
171
|
|
|
|
|
|
|
range => '\x21-\x7E', |
172
|
|
|
|
|
|
|
}, |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Unrecommended encodings. |
175
|
|
|
|
|
|
|
{ bytes => 2, |
176
|
|
|
|
|
|
|
dec_only => 1, |
177
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-2000-ascii', |
178
|
|
|
|
|
|
|
g => 'g0', |
179
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x4F", |
180
|
|
|
|
|
|
|
range => '\x21-\x7E', |
181
|
|
|
|
|
|
|
}, |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
# Nonstandard |
184
|
|
|
|
|
|
|
], |
185
|
|
|
|
|
|
|
SubChar => "\x{3013}", |
186
|
|
|
|
|
|
|
); |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
__PACKAGE__->Define( |
189
|
|
|
|
|
|
|
Alias => qr/\biso-?2022-?jp-?2004-?compatible$/i, |
190
|
|
|
|
|
|
|
Name => 'x-iso2022jp2004-compatible', |
191
|
|
|
|
|
|
|
CCS => [ |
192
|
|
|
|
|
|
|
{ cl => 1, |
193
|
|
|
|
|
|
|
encoding => 'ascii', |
194
|
|
|
|
|
|
|
g_init => 'g0', |
195
|
|
|
|
|
|
|
g_seq => "\e\x28\x42", |
196
|
|
|
|
|
|
|
}, |
197
|
|
|
|
|
|
|
{ bytes => 2, |
198
|
|
|
|
|
|
|
encoding => 'jis-x-0208-ascii', |
199
|
|
|
|
|
|
|
g => 'g0', |
200
|
|
|
|
|
|
|
g_seq => "\e\x24\x42", |
201
|
|
|
|
|
|
|
range => '\x21-\x7E', |
202
|
|
|
|
|
|
|
}, |
203
|
|
|
|
|
|
|
{ bytes => 2, |
204
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-ascii', |
205
|
|
|
|
|
|
|
g => 'g0', |
206
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x51", |
207
|
|
|
|
|
|
|
ss => '', # encodes runs as short as possible |
208
|
|
|
|
|
|
|
range => '\x21-\x7E', |
209
|
|
|
|
|
|
|
}, |
210
|
|
|
|
|
|
|
{ bytes => 2, |
211
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane2', |
212
|
|
|
|
|
|
|
g => 'g0', |
213
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x50", |
214
|
|
|
|
|
|
|
range => '\x21-\x7E', |
215
|
|
|
|
|
|
|
}, |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
# Unrecommended encodings. |
218
|
|
|
|
|
|
|
{ bytes => 2, |
219
|
|
|
|
|
|
|
dec_only => 1, |
220
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-2000-ascii', |
221
|
|
|
|
|
|
|
g => 'g0', |
222
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x4F", |
223
|
|
|
|
|
|
|
range => '\x21-\x7E', |
224
|
|
|
|
|
|
|
}, |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
# Nonstandard |
227
|
|
|
|
|
|
|
], |
228
|
|
|
|
|
|
|
SubChar => "\x{3013}", |
229
|
|
|
|
|
|
|
); |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
__PACKAGE__->Define( |
232
|
|
|
|
|
|
|
Alias => qr/\biso-?2022-?jp-?3$/i, |
233
|
|
|
|
|
|
|
Name => 'iso-2022-jp-3', |
234
|
|
|
|
|
|
|
CCS => [ |
235
|
|
|
|
|
|
|
{ cl => 1, |
236
|
|
|
|
|
|
|
encoding => 'ascii', |
237
|
|
|
|
|
|
|
g_init => 'g0', |
238
|
|
|
|
|
|
|
g_seq => "\e\x28\x42", |
239
|
|
|
|
|
|
|
}, |
240
|
|
|
|
|
|
|
{ bytes => 2, |
241
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane1-2000-ascii', |
242
|
|
|
|
|
|
|
g => 'g0', |
243
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x4F", |
244
|
|
|
|
|
|
|
range => '\x21-\x7E', |
245
|
|
|
|
|
|
|
}, |
246
|
|
|
|
|
|
|
{ bytes => 2, |
247
|
|
|
|
|
|
|
encoding => 'jis-x-0213-plane2', |
248
|
|
|
|
|
|
|
g => 'g0', |
249
|
|
|
|
|
|
|
g_seq => "\e\x24\x28\x50", |
250
|
|
|
|
|
|
|
range => '\x21-\x7E', |
251
|
|
|
|
|
|
|
}, |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
# Unrecommended encoding. |
254
|
|
|
|
|
|
|
{ bytes => 2, |
255
|
|
|
|
|
|
|
encoding => 'jis-x-0208-ascii', |
256
|
|
|
|
|
|
|
g => 'g0', |
257
|
|
|
|
|
|
|
g_seq => "\e\x24\x42", |
258
|
|
|
|
|
|
|
ss => '', # encodes runs as short as possible |
259
|
|
|
|
|
|
|
range => '\x21-\x7E', |
260
|
|
|
|
|
|
|
}, |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
# Nonstandard |
263
|
|
|
|
|
|
|
], |
264
|
|
|
|
|
|
|
SubChar => "\x{3013}", |
265
|
|
|
|
|
|
|
); |
266
|
|
|
|
|
|
|
|
267
|
0
|
|
|
0
|
1
|
|
sub needs_lines { 1 } |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
1; |
270
|
|
|
|
|
|
|
__END__ |