line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Encodings of Korean |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: Korean.pm,v 1.9 2007/11/29 14:29:53 you Exp $ |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Encode::Korean; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
29980
|
use 5.008008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
41
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
10
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
257
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = do { q$Revision: 1.9 $ =~ /\d+\.(\d+)/; sprintf "%.2f", $1 / 100 }; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import { |
15
|
0
|
0
|
0
|
0
|
|
|
if ( defined $_[1] and $_[1] eq ':modes') { |
16
|
0
|
|
|
|
|
|
require Exporter; |
17
|
0
|
|
|
|
|
|
our @ISA = qw(Exporter); |
18
|
0
|
|
|
|
|
|
our @EXPORT_OK = qw(enmode demode); |
19
|
0
|
|
|
|
|
|
__PACKAGE__->export_to_level(1, $_[0], 'enmode', 'demode'); |
20
|
0
|
|
|
|
|
|
splice @_, 1, 1; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
require Encode; |
24
|
0
|
|
|
|
|
|
Encode->export_to_level(1, @_); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# = transliteration-based encodings = |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
1
|
|
615
|
use Encode::Korean::ISO_TS_11941; # ISO TS 11941 |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
30
|
|
|
|
|
|
|
use Encode::Korean::SKR_2000; # South Korean Romanization 2000 |
31
|
|
|
|
|
|
|
use Encode::Korean::SKR_1984; # South Korean Romanization 1984 |
32
|
|
|
|
|
|
|
use Encode::Korean::SKR_1959; # South Korean Romanization 1959 |
33
|
|
|
|
|
|
|
use Encode::Korean::NKR_1992; # North Korean Romanization 1992 |
34
|
|
|
|
|
|
|
use Encode::Korean::MRR; # McCune-Reischauer |
35
|
|
|
|
|
|
|
use Encode::Korean::Yale; # Yale romanization for Korean |
36
|
|
|
|
|
|
|
use Encode::Korean::SKATS; # Standard Korean Alphabet Transliteration System |
37
|
|
|
|
|
|
|
use Encode::Korean::HSR; # Hangeul Society Romanization 1984 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# = modes = |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub enmode($@) { |
43
|
|
|
|
|
|
|
my $enc = shift; |
44
|
|
|
|
|
|
|
my $obj = Encode::find_encoding($enc); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
unless (defined $obj) { |
47
|
|
|
|
|
|
|
require Carp; |
48
|
|
|
|
|
|
|
Carp::croak("Unknown encoding '$enc'"); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
$obj->enmode(@_); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub demode($@) { |
54
|
|
|
|
|
|
|
my $enc = shift; |
55
|
|
|
|
|
|
|
my $obj = Encode::find_encoding($enc); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
unless (defined $obj) { |
58
|
|
|
|
|
|
|
require Carp; |
59
|
|
|
|
|
|
|
Carp::croak("Unknown encoding '$enc'"); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
$obj->demode(@_); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
__END__ |