~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/intl/chardet/tools/gengb18030.pl

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/local/bin/perl
 
2
use strict;
 
3
require "genverifier.pm";
 
4
use genverifier;
 
5
 
 
6
 
 
7
my(@gb18030_cls);
 
8
my(@gb18030_st);
 
9
my($gb18030_ver);
 
10
 
 
11
 
 
12
@gb18030_cls = (
 
13
 [ 0x0e , 0x0f , 0 ],
 
14
 [ 0x1b , 0x1b , 0 ],
 
15
 [ 0x30 , 0x39 , 3 ],
 
16
 [ 0x00 , 0x3f , 1 ],
 
17
 [ 0x40 , 0x7e , 2 ],
 
18
 [ 0x7f , 0x7f , 4 ],
 
19
 [ 0x80 , 0x80 , 5 ],
 
20
 [ 0x81 , 0xfe , 6 ],
 
21
 [ 0xff , 0xff , 0 ],
 
22
);
 
23
 
 
24
package genverifier;
 
25
@gb18030_st = (
 
26
#  0  1  2  3  4  5  6 
 
27
   1, 0, 0, 0, 0, 0, 3, # state 0
 
28
   1, 1, 1, 1, 1, 1, 1, # Error State - 1
 
29
   2, 2, 2, 2, 2, 2, 2, # ItsMe State - 2
 
30
   1, 1, 0, 4, 1, 0, 0, # state 3, multibytes, 1st byte identified
 
31
   1, 1, 1, 1, 1, 1, 5, # state 4, multibytes, 2nd byte identified
 
32
   1, 1, 1, 2, 1, 1, 1, # state 5, multibytes, 3rd byte identified
 
33
);
 
34
 
 
35
 
 
36
$gb18030_ver = genverifier::GenVerifier("gb18030", "gb18030", \@gb18030_cls, 7,     \@gb18030_st);
 
37
print $gb18030_ver;
 
38
 
 
39
 
 
40