|
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(@sjis_cls); |
|
12 my(@sjis_st); |
|
13 my($sjis_ver); |
|
14 |
|
15 @sjis_cls = ( |
|
16 [ 0x00 , 0x00 , 0 ], |
|
17 [ 0x0e , 0x0f , 0 ], |
|
18 [ 0x1b , 0x1b , 0 ], |
|
19 [ 0xfd , 0xff , 0 ], |
|
20 [ 0x85 , 0x86 , 3 ], |
|
21 [ 0xeb , 0xec , 5 ], |
|
22 [ 0x01 , 0x1a , 1 ], |
|
23 [ 0x1c , 0x3f , 1 ], |
|
24 [ 0x7f , 0x7f , 1 ], |
|
25 [ 0x40 , 0x7e , 2 ], |
|
26 [ 0xa1 , 0xdf , 2 ], |
|
27 [ 0x80 , 0x9f , 3 ], |
|
28 [ 0xa0 , 0xa0 , 4 ], |
|
29 [ 0xe0 , 0xea , 3 ], |
|
30 [ 0xed , 0xfc , 4 ], |
|
31 ); |
|
32 |
|
33 package genverifier; |
|
34 @sjis_st = ( |
|
35 # 0 1 2 3 4 5 |
|
36 1, 0, 0, 3, 1, 1, # Start State - 0 |
|
37 1, 1, 1, 1, 1, 1, # Error State - 1 |
|
38 2, 2, 2, 2, 2, 2, # ItsMe State - 2 |
|
39 1, 1, 0, 0, 0, 0, # State - 3 |
|
40 ); |
|
41 |
|
42 $sjis_ver = genverifier::GenVerifier("SJIS", "Shift_JIS", \@sjis_cls, 6, \@sjis_st); |
|
43 print $sjis_ver; |
|
44 |
|
45 |
|
46 |