|
1 #!/usr/local/bin/perl |
|
2 # This Source Code Form is subject to the terms of the Mozilla Public |
|
3 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
5 |
|
6 use strict; |
|
7 require "genverifier.pm"; |
|
8 use genverifier; |
|
9 |
|
10 |
|
11 my(@iso2022jp_cls); |
|
12 my(@iso2022jp_st); |
|
13 my($iso2022jp_ver); |
|
14 |
|
15 # 1:ESC 3:'(' 4:'B' 5:'J' 6:'@' 7:'$' 8:'D' 9:'I' |
|
16 @iso2022jp_cls = ( |
|
17 [ 0x0e , 0x0f , 2 ], |
|
18 [ 0x28 , 0x28 , 3 ], |
|
19 [ 0x42 , 0x42 , 4 ], |
|
20 [ 0x4a , 0x4a , 5 ], |
|
21 [ 0x40 , 0x40 , 6 ], |
|
22 [ 0x24 , 0x24 , 7 ], |
|
23 [ 0x44 , 0x44 , 8 ], |
|
24 [ 0x49 , 0x49 , 9 ], |
|
25 [ 0x01 , 0x1a , 0 ], |
|
26 [ 0x1c , 0x7f , 0 ], |
|
27 [ 0x1b , 0x1b , 1 ], |
|
28 [ 0x00 , 0x00 , 2 ], |
|
29 [ 0x80 , 0xff , 2 ] |
|
30 ); |
|
31 |
|
32 package genverifier; |
|
33 @iso2022jp_st = ( |
|
34 # 0 1 2 3 4 5 6 7 8 9 |
|
35 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, # Start State - 0 |
|
36 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, # Error State - 1 |
|
37 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, # ItsMe State - 2 |
|
38 1, 1, 1, 5, 1, 1, 1, 4, 1, 1, # got ESC |
|
39 1, 1, 1, 6, 2, 1, 2, 1, 1, 1, # got ESC $ |
|
40 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, # got ESC ( |
|
41 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, # got ESC $ ( |
|
42 ); |
|
43 |
|
44 $iso2022jp_ver = genverifier::GenVerifier("ISO2022JP", "ISO-2022-JP", |
|
45 \@iso2022jp_cls, 10, \@iso2022jp_st); |
|
46 print $iso2022jp_ver; |
|
47 |
|
48 |
|
49 |