MHonArc/Char/KR.pm untested

filter: Statementstmt 0.0% 0 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 10 CC 1 SCAR 6.9
CC
1
Cov
0%
kr_2022_to_euc
2.0
CRAP 2.0
1 ##---------------------------------------------------------------------------##
2 ## File:
3 ## $Id: KR.pm,v 1.1 2002/12/18 05:38:43 ehood Exp $
4 ## Author:
5 ## Earl Hood earl@earlhood.com
6 ##---------------------------------------------------------------------------##
7 ## Copyright (C) 2002 Earl Hood, earl@earlhood.com
8 ##
9 ## This program is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 2 of the License, or
12 ## (at your option) any later version.
13 ##
14 ## This program is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ## GNU General Public License for more details.
18 ##
19 ## You should have received a copy of the GNU General Public License
20 ## along with this program; if not, write to the Free Software
21 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 ## 02111-1307, USA
23 ##---------------------------------------------------------------------------##
24  
25 package MHonArc::Char::KR;
26  
27 our $VERSION = '2.6.24';
28  
29 sub kr_2022_to_euc {
30 # implementation of this function plagerized from Encode::KR::2022_KR.
31 my $data_r = shift;
32 my ($match);
33 $data_r =~ s/\e\$\)C//gx; # remove the designator
34 $data_r =~ s{\x0E # replace characters in GL
35 ([^\x0F]*) # between SO(\x0e) and SI(\x0f)
36 \x0F} # with characters in GR
37 {
38 $match = $1;
39 $match =~ tr/\x21-\x7e/\xa1-\xfe/;
40 $match;
41 }gex;
42 }
43  
44 1;