106 |
$CHARSET{G94n}->{'B@'}->{dimension} = 2; ## JIS X 0208-1990 |
$CHARSET{G94n}->{'B@'}->{dimension} = 2; ## JIS X 0208-1990 |
107 |
$CHARSET{G94n}->{'B@'}->{chars} = 94; |
$CHARSET{G94n}->{'B@'}->{chars} = 94; |
108 |
$CHARSET{G94n}->{'B@'}->{ucs} = 0xE9F6C0 + 94*94*79; |
$CHARSET{G94n}->{'B@'}->{ucs} = 0xE9F6C0 + 94*94*79; |
109 |
|
|
110 |
|
## SJIS G3 mapping (JIS X 0213:2000 plane 2) |
111 |
|
$CHARSET{G94n}->{"\x50"}->{Csjis_kuE} = { # ku - 1 |
112 |
|
0xF0 => 7, 0xF1 => 3, 0xF2 => 11, 0xF3 => 13, 0xF4 => 77, |
113 |
|
0xF5 => 79, 0xF6 => 81, 0xF7 => 83, 0xF8 => 85, 0xF9 => 87, |
114 |
|
0xFA => 89, 0xFB => 91, 0xFC => 93, |
115 |
|
}; |
116 |
|
$CHARSET{G94n}->{"\x50"}->{Csjis_kuO} = { # ku - 1 |
117 |
|
0xF0 => 0, 0xF1 => 2, 0xF2 => 4, 0xF3 => 12, 0xF4 => 14, |
118 |
|
0xF5 => 78, 0xF6 => 80, 0xF7 => 82, 0xF8 => 84, 0xF9 => 86, |
119 |
|
0xFA => 88, 0xFB => 90, 0xFC => 92, |
120 |
|
}; |
121 |
|
$CHARSET{G94n}->{"\x50"}->{Csjis_first} = { reverse ( |
122 |
|
%{ $CHARSET{G94n}->{"\x50"}->{Csjis_kuE} }, |
123 |
|
%{ $CHARSET{G94n}->{"\x50"}->{Csjis_kuO} }, |
124 |
|
)}; |
125 |
|
|
126 |
## -- Control character sets |
## -- Control character sets |
127 |
$CHARSET{C0}->{'@'}->{ucs} = 0x00; ## ISO/IEC 6429 C0 |
$CHARSET{C0}->{'@'}->{ucs} = 0x00; ## ISO/IEC 6429 C0 |
128 |
for ("\x40", "\x43", "\x44", "\x45", "\x46", "\x49", "\x4A", "\x4B", "\x4C") { |
for ("\x40", "\x43", "\x44", "\x45", "\x46", "\x49", "\x4A", "\x4B", "\x4C") { |
185 |
$CODING_SYSTEM{$F} = {}; |
$CODING_SYSTEM{$F} = {}; |
186 |
$CODING_SYSTEM{"\x2F".$F} = {reset_state => 1}; |
$CODING_SYSTEM{"\x2F".$F} = {reset_state => 1}; |
187 |
} |
} |
188 |
|
$CODING_SYSTEM{Csjis} = {perl_name => 'shiftjis'}; |
189 |
} |
} |
190 |
|
|
191 |
sub make_charset (%) { |
sub make_charset (%) { |
196 |
$CHARSET{ $settype }->{ $setid } = \%set; |
$CHARSET{ $settype }->{ $setid } = \%set; |
197 |
} |
} |
198 |
|
|
199 |
|
## Make a new ISO/IEC 2022-buffers object with default status |
200 |
|
sub new_object { |
201 |
|
my %C; |
202 |
|
$C{bit} = 8; |
203 |
|
$C{coding_system} = $CODING_SYSTEM{"\x40"}; ## ISO/IEC 2022 |
204 |
|
$C{CL} = 'C0'; $C{CR} = 'C1'; $C{ESC_Fe} = 'C1'; |
205 |
|
$C{C0} = $CHARSET{C0}->{"\x40"}; ## ISO/IEC 6429:1991 C0 |
206 |
|
$C{C1} = $CHARSET{C1}->{'64291991C1'}; ## ISO/IEC 6429:1991 C1 |
207 |
|
$C{GL} = 'G0'; $C{GR} = 'G1'; |
208 |
|
$C{G0} = $CHARSET{G94}->{"\x42"}; ## ISO/IEC 646:1991 IRV |
209 |
|
#$C{G1} = $CHARSET{G96}->{"\x41"}; ## ISO/IEC 8859-1 GR |
210 |
|
$C{G1} = $CHARSET{G94}->{"\x7E"}; ## empty set |
211 |
|
$C{G2} = $CHARSET{G94}->{"\x7E"}; ## empty set |
212 |
|
$C{G3} = $CHARSET{G94}->{"\x7E"}; ## empty set |
213 |
|
$C{option} = { |
214 |
|
C1invoke_to_right => 0, ## C1 invoked to: (0: ESC Fe, 1: CR) |
215 |
|
G94n_designate_long => 0, ## (1: ESC 02/04 02/08 04/00..02) |
216 |
|
designate_to => { ## Designated G buffer (-1: not be outputed) |
217 |
|
C0 => { |
218 |
|
default => 0, |
219 |
|
}, |
220 |
|
C1 => { |
221 |
|
default => 1, |
222 |
|
}, |
223 |
|
G94 => { |
224 |
|
"\x42" => 0, |
225 |
|
default => 0, |
226 |
|
}, |
227 |
|
G96 => { |
228 |
|
default => 1, |
229 |
|
}, |
230 |
|
G94n => { |
231 |
|
default => 0, |
232 |
|
}, |
233 |
|
G96n => { |
234 |
|
default => 1, |
235 |
|
}, |
236 |
|
coding_system => { |
237 |
|
default => -1, |
238 |
|
}, |
239 |
|
}, |
240 |
|
Ginvoke_by_single_shift => [0,0,0,0], ## Invoked by SS |
241 |
|
Ginvoke_to_left => [1,1,1,1], ## Which invoked to? (1: L, 0: R) |
242 |
|
private_set => { ## Private set vs Final byte |
243 |
|
C0 => [], |
244 |
|
C1 => [], |
245 |
|
G94 => [], |
246 |
|
G94n => [[],[],[],[],[]], |
247 |
|
G96 => [], |
248 |
|
#G96n => [], ## (not implemented) |
249 |
|
U96n => [], ## mule-unicode sets |
250 |
|
XC1 => { |
251 |
|
'64291991C1' => undef, ## ISO/IEC 6429:1991 C1 |
252 |
|
}, |
253 |
|
}, |
254 |
|
reset => { ## Reset status at top of line |
255 |
|
Gdesignation => "\x42", ## F of designation or 0 |
256 |
|
Ginvoke => 1, |
257 |
|
}, |
258 |
|
undef_char => ["\x3F", {type => 'G94', charset => 'B'}], |
259 |
|
use_revision => 1, ## Output IRR |
260 |
|
}; |
261 |
|
## Special code area (such as 0xFD-0xFF of sjis'es) |
262 |
|
$C{Gsmap} = {"\xA0" => "\x{F8F0}", "\xFD" => "\x{F8F1}", "\xFE" => "\x{F8F2}", "\xFF" => "\x{F8F3}"}; |
263 |
|
$C{GsmapR} = {}; ## Reversed table |
264 |
|
\%C; |
265 |
|
} |
266 |
|
|
267 |
|
sub new_object_sjis { |
268 |
|
my $C = new_object; |
269 |
|
$C->{coding_system} = $CODING_SYSTEM{Csjis}; |
270 |
|
$C->{CR} = undef; |
271 |
|
$C->{GR} = 'G2'; ## 0xA1-0xDF |
272 |
|
#$C->{G0} = $CHARSET{G94}->{J}; ## JIS X 0201:1997 Latin |
273 |
|
$C->{G1} = $CHARSET{G94n}->{'B@'}; ## JIS X 0208:1997 |
274 |
|
$C->{G2} = $CHARSET{G94}->{I}; ## JIS X 0201:1997 Katakana |
275 |
|
$C->{G3} = $CHARSET{G94n}->{"\x50"}; ## JIS X 0213:2000 plane 2 |
276 |
|
$C; |
277 |
|
} |
278 |
|
|
279 |
1; |
1; |
280 |
__END__ |
__END__ |
281 |
|
|