line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Unicode::Emoji::SoftBank - Emoji for SoftBank Mobile |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Unicode::Emoji::E4U; |
8
|
|
|
|
|
|
|
my $e4u = Unicode::Emoji::E4U->new; |
9
|
|
|
|
|
|
|
my $softbank = $e4u->softbank; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $e; |
12
|
|
|
|
|
|
|
$e = $softbank->list->[0]; |
13
|
|
|
|
|
|
|
$e = $softbank->find(unicode => 'E04A'); |
14
|
|
|
|
|
|
|
print "name_ja: ", $e->name_ja, "\n"; |
15
|
|
|
|
|
|
|
print "number: ", $e->number, "\n"; |
16
|
|
|
|
|
|
|
print "unicode: ", $e->unicode, "\n"; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $se = $e->softbank_emoji; |
19
|
|
|
|
|
|
|
print "is_alt: ", $se->is_alt, "\n"; |
20
|
|
|
|
|
|
|
print "unicode_string: ", $se->unicode_string, "\n"; |
21
|
|
|
|
|
|
|
print "unicode_octets: ", $se->unicode_octets, "\n"; |
22
|
|
|
|
|
|
|
print "cp932_string: ", $se->cp932_string, "\n"; |
23
|
|
|
|
|
|
|
print "cp932_octets: ", $se->cp932_octets, "\n"; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DEFINITION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
L |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 AUTHOR |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Yusuke Kawasaki, L |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SEE ALSO |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
L |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 COPYRIGHT |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Copyright 2009 Yusuke Kawasaki, all rights reserved. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
package Unicode::Emoji::SoftBank; |
44
|
7
|
|
|
7
|
|
44
|
use Unicode::Emoji::Base; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
173
|
|
45
|
7
|
|
|
7
|
|
38
|
use Any::Moose; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
48
|
|
46
|
|
|
|
|
|
|
extends 'Unicode::Emoji::Base::File::Carrier'; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
1
|
|
10
|
sub _dataxml { 'softbank/carrier_data.xml'; } |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
package Unicode::Emoji::SoftBank::XML::carrier_data; |
53
|
7
|
|
|
7
|
|
4422
|
use Any::Moose; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
31
|
|
54
|
|
|
|
|
|
|
has e => (is => 'ro', isa => 'Unicode::Emoji::SoftBank::XML::e'); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
package Unicode::Emoji::SoftBank::XML::e; |
57
|
7
|
|
|
7
|
|
3482
|
use Any::Moose; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
31
|
|
58
|
|
|
|
|
|
|
has name_ja => (is => 'ro', isa => 'Str'); |
59
|
|
|
|
|
|
|
has number => (is => 'ro', isa => 'Str'); |
60
|
|
|
|
|
|
|
has unicode => (is => 'ro', isa => 'Str'); |
61
|
|
|
|
|
|
|
has softbank_emoji => (is => 'ro', isa => 'Unicode::Emoji::Base::Emoji', lazy_build => 1); |
62
|
|
|
|
|
|
|
|
63
|
1
|
|
|
1
|
|
53
|
sub _build_softbank_emoji { Unicode::Emoji::SoftBank::Emoji->new(unicode_hex => $_[0]->unicode) }; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
package Unicode::Emoji::SoftBank::Emoji; |
66
|
7
|
|
|
7
|
|
7006
|
use Any::Moose; |
|
7
|
|
|
|
|
23
|
|
|
7
|
|
|
|
|
72
|
|
67
|
|
|
|
|
|
|
extends 'Unicode::Emoji::Base::Emoji::CP932'; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub _unicode_to_cp932 { |
70
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
71
|
1
|
|
|
|
|
3
|
my $code = shift; |
72
|
1
|
50
|
|
|
|
5
|
return if ($code < 0xE001); |
73
|
1
|
50
|
|
|
|
4
|
return if ($code > 0xE55A); |
74
|
1
|
|
|
|
|
3
|
my $page = ($code >> 8) & 7; |
75
|
1
|
|
|
|
|
3
|
my $sjisH = (0xF9, 0xF7, 0xF7, 0xF9, 0xFB, 0xFB)[$page]; |
76
|
1
|
|
|
|
|
4
|
my $sjisL = (0x40, 0x40, 0xA0, 0xA0, 0x40, 0xA0)[$page] + ($code&0x7F); |
77
|
1
|
50
|
33
|
|
|
10
|
$sjisL ++ if ($sjisL > 0x7E && $sjisL < 0xA1); |
78
|
1
|
|
|
|
|
16
|
( $sjisH << 8 | $sjisL ); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |