line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Unicode::Emoji::DoCoMo - Emoji for NTT DoCoMo |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Unicode::Emoji::E4U; |
8
|
|
|
|
|
|
|
my $e4u = Unicode::Emoji::E4U->new; |
9
|
|
|
|
|
|
|
my $docomo = $e4u->docomo; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $e; |
12
|
|
|
|
|
|
|
$e = $docomo->list->[0]; |
13
|
|
|
|
|
|
|
$e = $docomo->find(unicode => 'E63E'); |
14
|
|
|
|
|
|
|
print "jis: ", $e->jis, "\n"; |
15
|
|
|
|
|
|
|
print "name_en: ", $e->name_en, "\n"; |
16
|
|
|
|
|
|
|
print "name_ja: ", $e->name_ja, "\n"; |
17
|
|
|
|
|
|
|
print "unicode: ", $e->unicode, "\n"; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $de = $e->docomo_emoji; |
20
|
|
|
|
|
|
|
print "is_alt: ", $de->is_alt, "\n"; |
21
|
|
|
|
|
|
|
print "unicode_string: ", $de->unicode_string, "\n"; |
22
|
|
|
|
|
|
|
print "unicode_octets: ", $de->unicode_octets, "\n"; |
23
|
|
|
|
|
|
|
print "cp932_string: ", $de->cp932_string, "\n"; |
24
|
|
|
|
|
|
|
print "cp932_octets: ", $de->cp932_octets, "\n"; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DEFINITION |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
L |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 AUTHOR |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Yusuke Kawasaki, L |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SEE ALSO |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
L |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 COPYRIGHT |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Copyright 2009 Yusuke Kawasaki, all rights reserved. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
package Unicode::Emoji::DoCoMo; |
45
|
7
|
|
|
7
|
|
47
|
use Unicode::Emoji::Base; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
266
|
|
46
|
7
|
|
|
7
|
|
40
|
use Any::Moose; |
|
7
|
|
|
|
|
52
|
|
|
7
|
|
|
|
|
72
|
|
47
|
|
|
|
|
|
|
extends 'Unicode::Emoji::Base::File::Carrier'; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
50
|
|
|
|
|
|
|
|
51
|
1
|
|
|
1
|
|
10
|
sub _dataxml { 'docomo/carrier_data.xml'; } |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
package Unicode::Emoji::DoCoMo::XML::carrier_data; |
54
|
7
|
|
|
7
|
|
21264
|
use Any::Moose; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
39
|
|
55
|
|
|
|
|
|
|
has e => (is => 'ro', isa => 'Unicode::Emoji::DoCoMo::XML::e'); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
package Unicode::Emoji::DoCoMo::XML::e; |
58
|
7
|
|
|
7
|
|
4047
|
use Any::Moose; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
33
|
|
59
|
|
|
|
|
|
|
has jis => (is => 'ro', isa => 'Str'); |
60
|
|
|
|
|
|
|
has name_en => (is => 'ro', isa => 'Str'); |
61
|
|
|
|
|
|
|
has name_ja => (is => 'ro', isa => 'Str'); |
62
|
|
|
|
|
|
|
has unicode => (is => 'ro', isa => 'Str'); |
63
|
|
|
|
|
|
|
has docomo_emoji => (is => 'ro', isa => 'Unicode::Emoji::Base::Emoji', lazy_build => 1); |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
1
|
|
44
|
sub _build_docomo_emoji { Unicode::Emoji::DoCoMo::Emoji->new(unicode_hex => $_[0]->unicode) }; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
package Unicode::Emoji::DoCoMo::Emoji; |
68
|
7
|
|
|
7
|
|
4814
|
use Any::Moose; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
43
|
|
69
|
|
|
|
|
|
|
extends 'Unicode::Emoji::Base::Emoji::CP932'; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub _unicode_to_cp932 { |
72
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
73
|
1
|
|
|
|
|
3
|
my $code = shift; |
74
|
1
|
|
|
|
|
2
|
my $sjis; |
75
|
1
|
50
|
|
|
|
3
|
return if ($code < 0xE63E); |
76
|
1
|
50
|
|
|
|
4
|
return if ($code > 0xE757); |
77
|
1
|
50
|
|
|
|
4
|
if ( $code <= 0xE69B ) { |
|
|
0
|
|
|
|
|
|
78
|
1
|
|
|
|
|
2
|
$sjis = $code+4705; |
79
|
|
|
|
|
|
|
} elsif ( $code <= 0xE6DA ) { |
80
|
0
|
|
|
|
|
0
|
$sjis = $code+4772; |
81
|
|
|
|
|
|
|
} else { |
82
|
0
|
|
|
|
|
0
|
$sjis = $code+4773; |
83
|
|
|
|
|
|
|
} |
84
|
1
|
|
|
|
|
15
|
$sjis; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |