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