| 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; |