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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Sep 15 05:08:13 2002 UTC (23 years, 10 months ago) by wakaba
Branch: MAIN
Changes since 1.1: +4 -4 lines
2002-09-15  Wakaba <w@suika.fam.cx>

	* ISO2022.pm: New module.

1
2 =head1 NAME
3
4 Encode::ISO2022 --- ISO/IEC 2022 encoder and decoder
5
6 =cut
7
8 require v5.7.3;
9 package Encode::ISO2022;
10 use strict;
11 use vars qw(%CHARSET $VERSION);
12 $VERSION=do{my @r=(q$Revision: 1.1 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
13 use base qw(Encode::Encoding);
14 __PACKAGE__->Define (qw/iso-2022 iso2022 2022 cp2022/);
15
16 ### --- Intialization
17
18 my %_CHARS_to_RANGE = (
19 l94 => q/[\x21-\x7E]/,
20 l96 => q/[\x20-\x7F]/,
21 l128 => q/[\x00-\x7F]/,
22 l256 => q/[\x00-\xFF]/,
23 r94 => q/[\xA1-\xFE]/,
24 r96 => q/[\xA0-\xFF]/,
25 r128 => q/[\x80-\xFF]/,
26 r256 => q/[\x80-\xFF]/,
27 b94 => q/[\x21-\x7E\xA1-\xFE]/,
28 b96 => q/[\x20-\x7F\xA0-\xFF]/,
29 b128 => q/[\x00-\xFF]/,
30 b256 => q/[\x00-\xFF]/,
31 );
32
33 ## --- Make initial charset definitions
34 &_make_initial_charsets;
35 sub _make_initial_charsets () {
36 for my $f (0x30..0x7E) {
37 my $F = pack 'C', $f;
38