Upgrade to Encode 2.00.
[p5sagit/p5-mst-13.2.git] / ext / Encode / lib / Encode / KR / 2022_KR.pm
index b6a65b7..8b4052b 100644 (file)
@@ -1,23 +1,16 @@
 package Encode::KR::2022_KR;
-use Encode qw(:fallbacks);
-use base 'Encode::Encoding';
-
 use strict;
 
-our $VERSION = do { my @r = (q$Revision: 1.3 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 2.0 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
 
+use Encode qw(:fallbacks);
 
-my $canon = 'iso-2022-kr';
-my $obj = bless {name => $canon}, __PACKAGE__;
-$obj->Define($canon);
-
-sub name { return $_[0]->{name}; }
+use base qw(Encode::Encoding);
+__PACKAGE__->Define('iso-2022-kr');
 
-sub needs_lines { 1 }
+sub needs_lines  { 1 }
 
 sub perlio_ok { 
-    #exists $INC{"PerlIO/encoding.pm"} or return 0;
-    #PerlIO::encoding->VERSION >= 0.03 and return 1;
     return 0; # for the time being
 }
 
@@ -36,7 +29,7 @@ sub encode
     my ($obj, $utf8, $chk) = @_;
     # empty the input string in the stack so perlio is ok
     $_[1] = '' if $chk;
-    my $octet = Encode::encode('euc-jp', $utf8, FB_PERLQQ) ;
+    my $octet = Encode::encode('euc-kr', $utf8, FB_PERLQQ) ;
     euc_iso(\$octet);
     return $octet;
 }