line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Encodings based on Escape Sequence |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: Escape.pm,v 1.14 2007-12-05 22:08:33+09 you Exp $ |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Encode::Escape; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
31166
|
use 5.008008; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
44
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
10
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
240
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = do { q$Revision: 1.14 $ =~ /\d+\.(\d+)/; sprintf "%.2f", $1 / 100 }; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub import { |
16
|
0
|
0
|
0
|
0
|
|
|
if ( defined $_[1] and $_[1] eq ':modes') { |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
require Exporter; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
our @ISA = qw(Exporter); |
21
|
0
|
|
|
|
|
|
our @EXPORT_OK = qw(enmode demode); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
__PACKAGE__->export_to_level(1, $_[0], 'enmode', 'demode'); |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
splice @_, 1, 1; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
require Encode; |
29
|
0
|
|
|
|
|
|
Encode->export_to_level(1, @_); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
659
|
use Encode::Escape::ASCII; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
33
|
|
|
|
|
|
|
use Encode::Escape::Unicode; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub enmode ($@) { |
37
|
|
|
|
|
|
|
my $enc = shift; |
38
|
|
|
|
|
|
|
my $obj = Encode::find_encoding($enc); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
unless (defined $obj) { |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
require Carp; |
43
|
|
|
|
|
|
|
Carp::croak("Unknown encoding '$enc'"); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
$obj->enmode(@_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub demode ($@) { |
50
|
|
|
|
|
|
|
my $enc = shift; |
51
|
|
|
|
|
|
|
my $obj = Encode::find_encoding($enc); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
unless (defined $obj) { |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
require Carp; |
56
|
|
|
|
|
|
|
Carp::croak("Unknown encoding '$enc'"); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$obj->demode(@_); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
__END__ |