<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#
# $Id: CJKConstants.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp $
#

package Encode::CJKConstants;

use strict;
use warnings;
our $RCSID = q$Id: CJKConstants.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp $;
our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };

use Carp;

require Exporter;
our @ISA         = qw(Exporter);
our @EXPORT      = qw();
our @EXPORT_OK   = qw(%CHARCODE %ESC %RE);
our %EXPORT_TAGS = ( 'all' =&gt; [ @EXPORT_OK, @EXPORT ] );

my %_0208 = (
    1978 =&gt; '\e\$\@',
    1983 =&gt; '\e\$B',
    1990 =&gt; '\e&amp;\@\e\$B',
);

our %CHARCODE = (
    UNDEF_EUC     =&gt; "\xa2\xae",    # 〓 in EUC
    UNDEF_SJIS    =&gt; "\x81\xac",    # 〓 in SJIS
    UNDEF_JIS     =&gt; "\xa2\xf7",    # † -- used in unicode
    UNDEF_UNICODE =&gt; "\x20\x20",    # † -- used in unicode
);

our %ESC = (
    GB_2312   =&gt; "\e\$A",
    JIS_0208  =&gt; "\e\$B",
    JIS_0212  =&gt; "\e\$(D",
    KSC_5601  =&gt; "\e\$(C",
    ASC       =&gt; "\e\(B",
    KANA      =&gt; "\e\(I",
    '2022_KR' =&gt; "\e\$)C",
);

our %RE = (
    ASCII     =&gt; '[\x00-\x7f]',
    BIN       =&gt; '[\x00-\x06\x7f\xff]',
    EUC_0212  =&gt; '\x8f[\xa1-\xfe][\xa1-\xfe]',
    EUC_C     =&gt; '[\xa1-\xfe][\xa1-\xfe]',
    EUC_KANA  =&gt; '\x8e[\xa1-\xdf]',
    JIS_0208  =&gt; "$_0208{1978}|$_0208{1983}|$_0208{1990}",
    JIS_0212  =&gt; "\e" . '\$\(D',
    ISO_ASC   =&gt; "\e" . '\([BJ]',
    JIS_KANA  =&gt; "\e" . '\(I',
    '2022_KR' =&gt; "\e" . '\$\)C',
    SJIS_C    =&gt; '[\x81-\x9f\xe0-\xfc][\x40-\x7e\x80-\xfc]',
    SJIS_KANA =&gt; '[\xa1-\xdf]',
    UTF8      =&gt; '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]'
);

1;

=head1 NAME

Encode::CJKConstants.pm -- Internally used by Encode::??::ISO_2022_*

=cut

</pre></body></html>