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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Sun Sep 22 11:09:38 2002 UTC (23 years, 10 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +20 -3 lines
2002-09-22  Wakaba <w@suika.fam.cx>

	* ISO2022.pm (_internal_to_iso2022): Allow SP as a
	replacement character.

1 wakaba 1.1 require 5.7.3;
2     package Encode::EUCFixed;
3     use strict;
4     use vars qw(%DEFAULT $VERSION);
5 wakaba 1.3 $VERSION=do{my @r=(q$Revision: 1.2 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
6 wakaba 1.1
7     package Encode::EUCFixed::JP;
8     use base qw(Encode::Encoding);
9     __PACKAGE__->Define (qw/Extended_UNIX_Code_Fixed_Width_for_Japanese csEUCFixWidJapanese/);
10    
11     sub encode ($$;$) {
12     my ($obj, $str, $chk) = @_;
13     $_[1] = '' if $chk;
14     $str = Encode::encode ('euc-jp', $str);
15     $str =~ s{
16     ([\x00-\x8D\x90-\xA0\xFF]) ## CS0: ASCII
17     #([\xA0-\xFE][\xA0-\xFE]) ## CS1: JIS X 0208-1990
18     |\x8E([\xA0-\xFE]) ## CS2: JIS X 0201 Katakana
19     |\x8F([\xA0-\xFE])([\xA0-\xFE]) ## CS3: JIS X 0212-1990
20     }{
21     my ($c0, $c2, $c31, $c32) = ($1, $2, $3, $4);