package Encode
::KR
::2022_KR
;
our $VERSION = do { my @r = (q
$Revision: 1.5 $ =~ /\d+/g); sprintf "%d."."%02d" x
$#r, @r };
use Encode
qw(:fallbacks);
use base
qw(Encode::Encoding);
__PACKAGE__
->Define('iso-2022-kr');
return 0; # for the time being
my ($obj, $str, $chk) = @_;
my $residue = iso_euc
(\
$res);
$_[1] = $residue if $chk;
return Encode
::decode
('euc-kr', $res, FB_PERLQQ
);
my ($obj, $utf8, $chk) = @_;
# empty the input string in the stack so perlio is ok
my $octet = Encode
::encode
('euc-jp', $utf8, FB_PERLQQ
) ;
use Encode
::CJKConstants
qw(:all);
$$r_str =~ s/$RE{'2022_KR'}//gox; # remove the designator
$$r_str =~ s
{ # replace characters in GL
\x0e # between SO(\x0e) and SI(\x0f)
([^\x0f]*) # with characters in GR
$out =~ tr/\x21-\x7e/\xa1-\xfe/;
my ($residue) = ($$r_str =~ s/(\e.*)$//so);
no warnings
qw(uninitialized);
substr($$r_str,0,0)=$ESC{'2022_KR'}; # put the designator at the beg.
$$r_str =~ s
{ # move KS X 1001 characters in GR to GL
($RE{EUC_C
}+) # and enclose them with SO and SI
$str =~ tr/\xA1-\xFE/\x21-\x7E/;
Encode::KR::2022_KR -- internally used by Encode::KR