Commit | Line | Data |
---|---|---|
8e0fc1cd | 1 | # |
d6b7ef86 | 2 | # $Id: Constants.pm,v 0.92 2002/03/19 17:01:26 dankogai Exp $ |
8e0fc1cd NIS |
3 | # |
4 | ||
5 | package Encode::JP::Constants; | |
6 | ||
7 | use strict; | |
8 | use vars qw($RCSID $VERSION); | |
9 | ||
d6b7ef86 NIS |
10 | $RCSID = q$Id: Constants.pm,v 0.92 2002/03/19 17:01:26 dankogai Exp $; |
11 | $VERSION = do { my @r = (q$Revision: 0.92 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; | |
8e0fc1cd NIS |
12 | |
13 | use Carp; | |
14 | ||
15 | BEGIN { | |
16 | use Exporter; | |
17 | use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); | |
18 | @ISA = qw(Exporter); | |
19 | @EXPORT = qw(); | |
20 | @EXPORT_OK = qw(%CHARCODE %ESC %RE); | |
21 | %EXPORT_TAGS = ( 'all' => [ @EXPORT_OK, @EXPORT ] ); | |
22 | } | |
23 | ||
24 | use vars @EXPORT_OK; | |
25 | ||
26 | my %_0208 = ( | |
27 | 1978 => '\e\$\@', | |
28 | 1983 => '\e\$B', | |
29 | 1990 => '\e&\@\e\$B', | |
30 | ); | |
31 | ||
32 | %CHARCODE = ( | |
33 | UNDEF_EUC => "\xa2\xae", # ¢® in EUC | |
34 | UNDEF_SJIS => "\x81\xac", # ¢® in SJIS | |
35 | UNDEF_JIS => "\xa2\xf7", # ¢÷ -- used in unicode | |
36 | UNDEF_UNICODE => "\x20\x20", # ¢÷ -- used in unicode | |
37 | ); | |
38 | ||
39 | %ESC = ( | |
40 | JIS_0208 => "\e\$B", | |
41 | JIS_0212 => "\e\$(D", | |
42 | ASC => "\e\(B", | |
43 | KANA => "\e\(I", | |
44 | ); | |
45 | ||
46 | %RE = | |
47 | ( | |
48 | ASCII => '[\x00-\x7f]', | |
49 | BIN => '[\x00-\x06\x7f\xff]', | |
50 | EUC_0212 => '\x8f[\xa1-\xfe][\xa1-\xfe]', | |
51 | EUC_C => '[\xa1-\xfe][\xa1-\xfe]', | |
52 | EUC_KANA => '\x8e[\xa1-\xdf]', | |
53 | JIS_0208 => "$_0208{1978}|$_0208{1983}|$_0208{1990}", | |
54 | JIS_0212 => "\e" . '\$\(D', | |
55 | JIS_ASC => "\e" . '\([BJ]', | |
56 | JIS_KANA => "\e" . '\(I', | |
57 | SJIS_C => '[\x81-\x9f\xe0-\xfc][\x40-\x7e\x80-\xfc]', | |
58 | SJIS_KANA => '[\xa1-\xdf]', | |
59 | UTF8 => '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]' | |
60 | ); | |
61 | ||
62 | 1; | |
63 |