1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/chardet/tools/geneucjp.pl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +#!/usr/local/bin/perl 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +use strict; 1.10 +require "genverifier.pm"; 1.11 +use genverifier; 1.12 + 1.13 + 1.14 +my(@eucjp_cls); 1.15 +my(@eucjp_st); 1.16 +my($eucjp_ver); 1.17 + 1.18 + 1.19 +@eucjp_cls = ( 1.20 + [ 0x0e , 0x0f , 5 ], 1.21 + [ 0xe0 , 0xfe , 0 ], 1.22 + [ 0x8e , 0x8e , 1 ], 1.23 + [ 0xa1 , 0xdf , 2 ], 1.24 + [ 0x8f , 0x8f , 3 ], 1.25 + [ 0x01 , 0x1a , 4 ], 1.26 + [ 0x1c , 0x7f , 4 ], 1.27 + [ 0x00 , 0x00 , 4 ], 1.28 + [ 0x1b , 0x1b , 5 ], 1.29 + [ 0x80 , 0x8d , 5 ], 1.30 + [ 0xa0 , 0xa0 , 5 ], 1.31 + [ 0x80 , 0xff , 5 ] 1.32 +); 1.33 + 1.34 +package genverifier; 1.35 +@eucjp_st = ( 1.36 +# 0 1 2 3 4 5 1.37 + 3, 4, 3, 5, 0, 1, # state 0 1.38 + 1, 1, 1, 1, 1, 1, # Error State - 1 1.39 + 2, 2, 2, 2, 2, 2, # ItsMe State - 2 1.40 + 0, 1, 0, 1, 1, 1, # state 3 1.41 + 1, 1, 0, 1, 1, 1, # state 4 1.42 + 3, 1, 3, 1, 1, 1, # state 5 1.43 +); 1.44 + 1.45 + 1.46 +$eucjp_ver = genverifier::GenVerifier("EUCJP", "EUC-JP", \@eucjp_cls, 6, \@eucjp_st); 1.47 +print $eucjp_ver; 1.48 + 1.49 + 1.50 +