/[suikacvs]/test/oldencodeutils/lib/Encode/Charset.pm
Suika

Contents of /test/oldencodeutils/lib/Encode/Charset.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Sat Oct 12 11:03:00 2002 UTC (23 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.3: +12 -9 lines
2002-10-12  Nanashi-san

	* SJIS.pm: New module.
	* SJIS/: New directory.
	(Commited by Wakaba <w@suika.fam.cx>)

1 wakaba 1.1
2     =head1 NAME
3    
4     Encode::Charset --- Coded Character Sets objects,
5     used by Encode::ISO2022, Encode::SJIS, and other modules.
6    
7     =cut
8    
9     package Encode::Charset;
10     use strict;
11     use vars qw(%CHARSET %CODING_SYSTEM $VERSION);
12 wakaba 1.4 $VERSION=do{my @r=(q$Revision: 1.3 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
13 wakaba 1.1
14     ## --- Make initial charset definitions
15     &_make_initial_charsets;
16     sub _make_initial_charsets () {
17     for my $f (0x30..0x7E) {
18     my $F = pack 'C', $f;
19     for ('', '!', '"', '#') {
20     $CHARSET{G94}->{ $_.$F }->{dimension} = 1;
21     $CHARSET{G94}->{ $_.$F }->{chars} = 94;
22     $CHARSET{G94}->{ $_.$F }->{ucs} =
23     {'' => 0xE90940, '!' => 0xE944A0, '"' => 0xE98000, '#' => 0xE9BB60}->{ $_ }
24     + 94 * ($f-0x30);
25    
26     $CHARSET{G96}->{ $_.$F }->{dimension} = 1;
27     $CHARSET{G96}->{ $_.$F }->{chars} = 96;
28     $CHARSET{G96}->{ $_.$F }->{ucs} =
29     {'' => 0xE926A0, '!' => 0xE96200, '"' => 0xE99D60, '#' => 0xE9D8C0}->{ $_ }
30     + 96 * ($f-0x30);
31    
32     $CHARSET{C0}->{ $_.$F }->{dimension} = 1;
33     $CHARSET{C0}->{ $_.$F }->{chars} = 32;
34     $CHARSET{C0}->{ $_.$F }->{ucs} =
35     {'' => 0x70000000, '!' => 0x70001400,
36     '"' => 0x70002800, '#' => 0x70003C00}->{ $_ } + 32 * ($f-0x30);
37    
38     $CHARSET{C1}->{ $_.$F }->{dimension} = 1;
39     $CHARSET{C1}->{ $_.$F }->{chars} = 32;
40     $CHARSET{C1}->{ $_.$F }->{ucs} =
41     {'' => 0x70000A00, '!' => 0x70001E00,
42     '"' => 0x70003200, '#' => 0x70004600}->{ $_ } + 32 * ($f-0x30);
43    
44     $CHARSET{G94}->{ ' '.$_.$F }->{dimension} = 1; ## DRCS
45     $CHARSET{G94}->{ ' '.$_.$F }->{chars} = 94;
46     $CHARSET{G94}->{ ' '.$_.$F }->{ucs} =
47     {'' => 0x70090940, '!' => 0x700944A0,
48     '"' => 0x70098000, '#' => 0x7009BB60}->{ $_ } + 94 * ($f-0x30);
49    
50     $CHARSET{G96}->{ ' '.$_.$F }->{dimension} = 1; ## DRCS
51     $CHARSET{G96}->{ ' '.$_.$F }->{chars} = 96;
52     $CHARSET{G96}->{ ' '.$_.$F }->{ucs} =
53     {'' => 0x700926A0, '!' => 0x70096200,
54     '"' => 0x70099D60, '#' => 0x7009D8C0}->{ $_ } + 96 * ($f-0x30);
55