/[suikacvs]/perl/lib/Encode/Charset/Private.pm
Suika

Contents of /perl/lib/Encode/Charset/Private.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Oct 16 10:39:05 2002 UTC (22 years, 1 month ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
2002-10-16  Nanashi-san <nanashi@san.invalid>

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

1 wakaba 1.1
2     =head1 NAME
3    
4     Encode::Charset::Private --- Coded character sets objects,
5     used by Encode::ISO2022, Encode::SJIS, and other modules
6     --- Coded character sets not registered in ISO-IR
7    
8     =cut
9    
10     package Encode::Charset::Private;
11     use strict;
12     our $VERSION=do{my @r=(q$Revision: 1.4 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
13     require Encode::Charset;
14    
15     sub import ($@) {
16     shift;
17     my %item;
18     for (@_) {
19     $item{$_} = 1;
20     }
21     if ($item{':gb'}) {
22     my $c = 0x70420000;
23     for (0..4,6) {
24     $Encode::Charset::CHARSET{G94n}->{'P0_'.$_} = {
25     chars => 94, dimension => 2, ucs => $c + 94*94*$_,
26     };
27     $Encode::Charset::CHARSET{G94n}->{
28     [qw/CSgb12345 CSgb7589 CSgb13131 CSgb7590 CSgb13132 _ CSgb16500/]->[$_]
29     } = $Encode::Charset::CHARSET{G94n}->{'P0_'.$_};
30     }
31     }
32     if ($item{':cns'}) {
33     my $c = 0x70430000;
34     for (0..6) {
35     $Encode::Charset::CHARSET{G94n}->{'P1_'.$_} = {
36     chars => 94, dimension => 2, ucs => $c + 94*94*$_,
37     };
38     $Encode::Charset::CHARSET{G94n}->{'CScns11643_'.(8+$_)}
39     = $Encode::Charset::CHARSET{G94n}->{'P1_'.$_};
40     }
41     $c = 0x70440000;
42     for (0..1) {
43     $Encode::Charset::CHARSET{G94n}->{'P2_'.$_} = {
44     chars => 94, dimension => 2, ucs => $c + 94*94*$_,
45     };
46     $Encode::Charset::CHARSET{G94n}->{'CScns11643_'.(15+$_)}
47     = $Encode::Charset::CHARSET{G94n}->{'P2_'.$_};
48     }
49     }
50     if ($item{':mule'}) {
51     my $c = 0x70450000;
52     for (1..6) {
53     $Encode::Charset::CHARSET{G94n}->{'P3_'.$_} = {
54     chars => 94, dimension => 2, ucs => $c + 94*94*$_,
55     };
56     $Encode::Charset::CHARSET{G94n}->{
57     [qw/_ CSmule_ethiopic CSmule_indian_2column CSmule_indian_1column
58     CSmule_tibetan CSmule_tibetan_1column CSmule_thai_xtis/]->[$_]
59     } = $Encode::Charset::CHARSET{G94n}->{'P3_'.$_};
60     }
61     $c = 0x70400000;
62     for (0..5) {
63     $Encode::Charset::CHARSET{G94}->{'P'.$_} = {
64     chars => 94, dimension => 1, ucs => $c + 94*$_,
65     };
66     $Encode::Charset::CHARSET{G94}->{
67     [qw/CSomron_sisheng CSmule_lao CSmule_arabic_digit
68     CSmule_arabic_1column CSmule_arabic_2column
69     CSis13194/]->[$_]
70     } = $Encode::Charset::CHARSET{G94}->{'P'.$_};
71     }
72     $Encode::Charset::CHARSET{G94}->{CSmule2_thai} = {
73     chars => 94, dimension => 1, ucs => 0xE926A0+96*0x24+1,
74     }; ## TIS 620
75     $c = 0x70410000;
76     for (0..2) {
77     $Encode::Charset::CHARSET{G96}->{'P'.$_} = {
78     chars => 96, dimension => 1, ucs => $c + 96*$_,
79     };
80     $Encode::Charset::CHARSET{G96}->{
81     [qw/CSmule_ipa CSviscii_lower CSviscii_upper/]->[$_]
82     } = $Encode::Charset::CHARSET{G96}->{'P'.$_};
83     }
84     $Encode::Charset::CHARSET{G96n}->{CSmule_ucs_0100}
85     = {chars => 96, dimension => 2, ucs => 0x0100};
86     $Encode::Charset::CHARSET{G96n}->{CSmule_ucs_2400}
87     = {chars => 96, dimension => 2, ucs => 0x2400};
88     $Encode::Charset::CHARSET{G96n}->{CSmule_ucs_E000}
89     = {chars => 96, dimension => 2, ucs => 0xE000};
90     }
91     }
92    
93     sub designate_mule ($) {
94     my $C = shift;
95     #$C->{option}->{final_to_set}->{G94n}->{"\x30"} = "CSmule_big5_1";
96     #$C->{option}->{final_to_set}->{G94n}->{"\x31"} = "CSmule_big5_2";
97     #$C->{option}->{final_to_set}->{G94n}->{"\x32"} = "CSmule2_ethiopic";
98     $C->{option}->{final_to_set}->{G94n}->{"\x33"} = "CSmule_ethiopic";
99     $C->{option}->{private_set}->{G94n}->[3]->[1] = "\x33";
100     $C->{option}->{final_to_set}->{G94n}->{"\x35"} = "CSmule_indian_2column";
101     $C->{option}->{private_set}->{G94n}->[3]->[2] = "\x35";
102     $C->{option}->{final_to_set}->{G94n}->{"\x36"} = "CSmule_indian_1column";
103     $C->{option}->{private_set}->{G94n}->[3]->[3] = "\x36";
104     $C->{option}->{final_to_set}->{G94n}->{"\x37"} = "CSmule_tibetan";
105     $C->{option}->{private_set}->{G94n}->[3]->[4] = "\x37";
106     $C->{option}->{final_to_set}->{G94n}->{"\x38"} = "CSmule_tibetan_1column";
107     $C->{option}->{private_set}->{G94n}->[3]->[5] = "\x38";
108     $C->{option}->{final_to_set}->{G94n}->{"\x3F"} = "CSmule_thai_xtis";
109     $C->{option}->{private_set}->{G94n}->[3]->[6] = "\x3F";
110    
111     $C->{option}->{final_to_set}->{G94}->{"\x30"} = "CSomron_sisheng";
112     $C->{option}->{private_set}->{G94}->[0] = "\x30";
113     #$C->{option}->{final_to_set}->{G94}->{"\x31"} = "CSmule2_thai";
114     $C->{option}->{final_to_set}->{G94}->{"\x31"} = "CSmule_lao";
115     $C->{option}->{private_set}->{G94}->[1] = "\x31";
116     $C->{option}->{final_to_set}->{G94}->{"\x32"} = "CSmule_arabic_digit";
117     $C->{option}->{private_set}->{G94}->[2] = "\x32";
118     $C->{option}->{final_to_set}->{G94}->{"\x33"} = "CSmule_arabic_1column";
119     $C->{option}->{private_set}->{G94}->[3] = "\x33";
120     $C->{option}->{final_to_set}->{G94}->{"\x34"} = "CSmule_arabic_2column";
121     $C->{option}->{private_set}->{G94}->[4] = "\x34";
122     $C->{option}->{final_to_set}->{G94}->{"\x35"} = "CSis13194";
123     $C->{option}->{private_set}->{G94}->[5] = "\x35";
124    
125     $C->{option}->{final_to_set}->{G96}->{"\x30"} = "CSmule_ipa";
126     $C->{option}->{private_set}->{G96}->[0] = "\x30";
127     $C->{option}->{final_to_set}->{G96}->{"\x31"} = "CSviscii_lower";
128     $C->{option}->{private_set}->{G96}->[1] = "\x31";
129     $C->{option}->{final_to_set}->{G96}->{"\x32"} = "CSviscii_upper";
130     $C->{option}->{private_set}->{G96}->[2] = "\x32";
131    
132     # 96^2 03/00 = bitmap
133     $C->{option}->{final_to_set}->{G96n}->{"\x31"} = "CSmule_ucs_0100";
134     $C->{option}->{private_set}->{U96n}->[0] = "\x31";
135     $C->{option}->{final_to_set}->{G96n}->{"\x32"} = "CSmule_ucs_2400";
136     $C->{option}->{private_set}->{U96n}->[1] = "\x32";
137     $C->{option}->{final_to_set}->{G96n}->{"\x33"} = "CSmule_ucs_E000";
138     $C->{option}->{private_set}->{U96n}->[2] = "\x33";
139     }
140    
141     1;
142     __END__
143    
144     =head1 EXAMPLE
145    
146     use Encode::Charset::Private qw(:mule); ## Load mule private charsets
147     my $C = Encode::Charset->new_object;
148     Encode::Charset::Private::designate_mule ($C);
149    
150     =head1 LICENSE
151    
152     Copyright 2002 Nanashi-san
153    
154     This library is free software; you can redistribute it
155     and/or modify it under the same terms as Perl itself.
156    
157     =cut
158    
159     # $Date: 2002/10/12 11:03:00 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24