intl/chardet/tools/gencp1252.pl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/chardet/tools/gencp1252.pl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     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(@cp1252_cls);
    1.15 +my(@cp1252_st);
    1.16 +my($cp1252_ver);
    1.17 +
    1.18 +
    1.19 +@cp1252_cls = (
    1.20 + [ 0x00 , 0x00 , 1 ],
    1.21 + [ 0x0e , 0x0f , 0 ],
    1.22 + [ 0x1b , 0x1b , 0 ],
    1.23 + [ 0x81 , 0x81 , 0 ],
    1.24 + [ 0x8d , 0x8d , 0 ],
    1.25 + [ 0x8f , 0x8f , 0 ],
    1.26 + [ 0x90 , 0x90 , 0 ],
    1.27 + [ 0x9d , 0x9d , 0 ],
    1.28 + [ 0xc0 , 0xd6 , 1 ],
    1.29 + [ 0xd8 , 0xf6 , 1 ],
    1.30 + [ 0xf8 , 0xff , 1 ],
    1.31 + [ 0x8a , 0x8a , 1 ],
    1.32 + [ 0x8c , 0x8c , 1 ],
    1.33 + [ 0x8e , 0x8e , 1 ],
    1.34 + [ 0x9a , 0x9a , 1 ],
    1.35 + [ 0x9c , 0x9c , 1 ],
    1.36 + [ 0x9e , 0x9e , 1 ],
    1.37 + [ 0x9f , 0x9f , 1 ],
    1.38 + [ 0x00 , 0xff , 2 ],
    1.39 +);
    1.40 +
    1.41 +package genverifier;
    1.42 +@cp1252_st = (
    1.43 +# 0  1  2  
    1.44 +  1, 3, 0,  # Start State - 0
    1.45 +  1, 1, 1,  # Error State - 1
    1.46 +  2, 2, 2,  # ItsMe State - 2
    1.47 +  1, 4, 0,  #       State - 3
    1.48 +  1, 5, 4,  #       State - 4
    1.49 +  1, 1, 4,  #       State - 5
    1.50 +);
    1.51 +
    1.52 +
    1.53 +$cp1252_ver = genverifier::GenVerifier("CP1252", "windows-1252", 
    1.54 +         \@cp1252_cls, 3,     \@cp1252_st);
    1.55 +print $cp1252_ver;
    1.56 +
    1.57 +
    1.58 +

mercurial