/[suikacvs]/test/oldencodeutils/lib/Encode/Table/JISEditions.pm
Suika

Contents of /test/oldencodeutils/lib/Encode/Table/JISEditions.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Oct 14 06:56:53 2002 UTC (23 years, 9 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
2002-10-14  Nanashi-san

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

1 wakaba 1.1
2     =head1 NAME
3    
4     Encode::Table::JISEditions --- Code point unification tables of
5     JIS coded character sets
6    
7     =cut
8    
9     package Encode::Table::JISEditions;
10     use strict;
11     our $VERSION=do{my @r=(q$Revision: 1.1 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
12    
13     my $start94n = 0xE9F6C0;
14     my $start1978 = $start94n + 94*94*(0x40-0x30);
15     my $start1983 = $start94n + 94*94*(0x42-0x30);
16     my $start1990 = $start94n + 94*94*79;
17     my $start2000 = $start94n + 94*94*(0x4F-0x30);
18    
19     for (0..94*94-1) {
20     $Encode::Table::TABLE{jisx0208_1978_to_1983__cpunify}->{chr ($_ + $start1978)} = chr ($_ + $start1983);
21     $Encode::Table::TABLE{jisx0208_1978_to_1990__cpunify}->{chr ($_ + $start1978)} = chr ($_ + $start1990);
22     $Encode::Table::TABLE{jisx0208_1983_to_1990__cpunify}->{chr ($_ + $start1983)} = chr ($_ + $start1990);
23     }
24     $Encode::Table::TABLE{jisx0208_1983_to_1978__cpunify} = {reverse %{$Encode::Table::TABLE{jisx0208_1978_to_1983__cpunify}}};
25     $Encode::Table::TABLE{jisx0208_1990_to_1978__cpunify} = {reverse %{$Encode::Table::TABLE{jisx0208_1978_to_1990__cpunify}}};
26     $Encode::Table::TABLE{jisx0208_1990_to_1983__cpunify} = {reverse %{$Encode::Table::TABLE{jisx0208_1983_to_1990__cpunify}}};
27    
28     my $startlatin = 0xE90940 + 94*(ord ('J')-0x30);
29     for (0..93) {
30     $Encode::Table::TABLE{jisx0201_latin_to_ascii__cpunify}->{chr ($startlatin + $_)} = chr ($_ + 0x21);
31     }
32     $Encode::Table::TABLE{ascii_to_jisx0201_latin__cpunify} = {reverse %{$Encode::Table::TABLE{jisx0201_latin_to_ascii__cpunify}}};
33    
34     my @hw = split //, q(!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~);
35     my @fw = qw(�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��);
36     for (0..93) {
37     $Encode::Table::TABLE{jisx0208_1990_to_ascii}->{chr ($start1990 + (ord ($fw[$_]) - 0xA1) * 94 + (ord (substr ($fw[$_], 1)) - 0xA1))} = $hw[$_];
38     }
39     $Encode::Table::TABLE{ascii_to_jisx0208_1990} = {reverse %{$Encode::Table::TABLE{jisx0208_1990_to_ascii}}};
40    
41     my $startkatakana = 0xE90940 + 94*(ord ('I')-0x30);
42     @hw = qw(�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��);
43     @fw = qw(�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��);
44     for (0..0x3E) {
45     $Encode::Table::TABLE{jisx0208_1990_to_jisx0201_katakana}->{chr ($start1990 + (ord ($fw[$_]) - 0xA1) * 94 + (ord (substr ($fw[$_], 1)) - 0xA1))} = chr ($startkatakana + ord (substr ($hw[$_], 1)) - 0xA1);
46     }
47     $Encode::Table::TABLE{jisx0201_katakana_to_jisx0208_1990} = {reverse %{$Encode::Table::TABLE{jisx0208_1990_to_jisx0201_katakana}}};
48    
49     1;
50    
51     =head1 SEE ALSO
52    
53     L<Encode::Table>
54    
55     =head1 LICENSE
56    
57     Copyright 2002 Nanashi-san
58    
59     This library is free software; you can redistribute it
60     and/or modify it under the same terms as Perl itself.
61    
62     =cut
63    
64     # $Date: 2002/10/12 11:03:00 $
65     ### JISEditions.pm ends here

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24