File Coverage

blib/lib/Encode/JP/Emoji.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             Encode::JP::Emoji - Emoji encodings and cross-mapping tables in pure Perl
4              
5             =head1 SYNOPSIS
6              
7             use Encode;
8             use Encode::JP::Emoji;
9              
10             # DoCoMo Shift_JIS octets to DoCoMo UTF-8 octets
11             my $sun = "\xF8\x9F";
12             Encode::from_to($sun, 'x-sjis-emoji-docomo', 'utf8');
13              
14             # KDDI Shift_JIS octets to SoftBank Shift_JIS octets
15             my $scream = "\xF7\xF5";
16             Encode::from_to($scream, 'x-sjis-e4u-kddiapp', 'x-sjis-e4u-softbank3g');
17              
18             # DoCoMo UTF-8 octets to Google UTF-8 octets
19             my $keycap1 = "\xEE\x9B\xA2";
20             Encode::from_to($keycap1, 'x-utf8-e4u-docomo', 'utf8');
21              
22             # Google UTF-8 string to KDDI Shift_JIS octets
23             my $newmoon = "\x{FE011}";
24             my $kddi = Encode::encode('x-sjis-e4u-kddiweb', $newmoon);
25              
26             # SoftBank Shift_JIS octets to SoftBank UTF-8 string
27             my $clover = "\xF7\x50";
28             my $softbank = Encode::decode('x-sjis-emoji-softbank3g', $clover);
29              
30             =head1 DESCRIPTION
31              
32             This module provides encodings which support emoji picture characters.
33              
34             The first group of encodings uses carriers' private code points
35             as Perl's internal string which has UTF-8 flag on.
36              
37             Name Encoding Octets Emoji String Emoji
38             --------------------------------------------------------------------
39             x-sjis-emoji-docomo Shift_JIS DoCoMo DoCoMo
40             x-sjis-emoji-kddiapp Shift_JIS KDDI KDDI(app)
41             x-sjis-emoji-kddiweb Shift_JIS KDDI KDDI(web)
42             x-sjis-emoji-softbank2g Shift_JIS SoftBank(2G) SoftBank
43             x-sjis-emoji-softbank3g Shift_JIS SoftBank(3G) SoftBank
44             x-utf8-emoji-docomo UTF-8 DoCoMo DoCoMo
45             x-utf8-emoji-kddiapp UTF-8 KDDI(app) KDDI(app)
46             x-utf8-emoji-kddiweb UTF-8 KDDI(web) KDDI(web)
47             x-utf8-emoji-softbank2g UTF-8 SoftBank(2G) SoftBank
48             x-utf8-emoji-softbank3g UTF-8 SoftBank(3G) SoftBank
49             --------------------------------------------------------------------
50              
51             KDDI has two version of thier private code points.
52             KDDI(app) is official and documented version used in EZappli and character references.
53             KDDI(web), on the other hand, is B but used in UTF-8 web pages.
54             Use KDDI(web) encoding recommended in most cases.
55              
56             SoftBank also has two version of thier emoji representations.
57             SoftBank(2G) uses escape sequence style.
58             SoftBank(3G) uses binary representations.
59             Use SoftBank(3G) encoding recommended in most cases.
60              
61             The second group uses Googles's private code points internaly.
62             This means Google's encoding could be the interchange encoding for others.
63              
64             Name Encoding Octets Emoji String Emoji
65             --------------------------------------------------------------------
66             x-sjis-e4u-docomo Shift_JIS DoCoMo Google
67             x-sjis-e4u-kddiapp Shift_JIS KDDI Google
68             x-sjis-e4u-kddiweb Shift_JIS KDDI Google
69             x-sjis-e4u-softbank2g Shift_JIS SoftBank(2G) Google
70             x-sjis-e4u-softbank3g Shift_JIS SoftBank(3G) Google
71             x-utf8-e4u-docomo UTF-8 DoCoMo Google
72             x-utf8-e4u-kddiapp UTF-8 KDDI(app) Google
73             x-utf8-e4u-kddiweb UTF-8 KDDI(web) Google
74             x-utf8-e4u-softbank2g UTF-8 SoftBank(2G) Google
75             x-utf8-e4u-softbank3g UTF-8 SoftBank(3G) Google
76             --------------------------------------------------------------------
77              
78             The cross-carriers mapping tables are based on emoji4unicode,
79             Emoji for Unicode, project on Google Code.
80             See more detail on L about the project.
81              
82             The next group also uses Google's.
83              
84             Name Encoding Octets Emoji String Emoji
85             --------------------------------------------------------------------
86             x-utf8-e4u-unicode UTF-8 Unicode Std. Google
87             x-utf8-e4u-google UTF-8 Google Google
88             x-utf8-e4u-mixed UTF-8 (mixed) Google
89             --------------------------------------------------------------------
90              
91             C encodes the Unicode 6.0 emojis.
92              
93             C does B translations and exists only for useful.
94              
95             C accepts all emojis of three mobile carriers mixed.
96             On decoding, however, KDDI(app) emojis would be broken as they have conflicts
97             with SoftBank emojis. So B use KDDI(app) with this.
98             On encoding, this replaces Google emojis to others definitively.
99             This encoding is friendly for L and MySQL 5.4.
100             Note that MySQL before 5.5.3 does not support four bytes UTF-8 including
101             both Google and Unicode Standard emojis.
102              
103             Tha last group rejects any emojis above.
104             You would use these encodings with L fallback functions.
105              
106             Name Encoding
107             --------------------------------------------------------------------
108             x-sjis-emoji-none Shift_JIS
109             x-utf8-emoji-none UTF-8
110             x-sjis-e4u-none Shift_JIS
111             x-utf8-e4u-none UTF-8
112             --------------------------------------------------------------------
113              
114             =head1 DEPENDENCIES
115              
116             This module requires Perl version 5.8.1 or later.
117              
118             L is not required on run time.
119              
120             =head1 LINKS
121              
122             =over 4
123              
124             =item * Subversion Trunk
125              
126             L
127              
128             =item * Project Hosting on Google Code
129              
130             L
131              
132             =item * Google Groups and some Japanese documents
133              
134             L
135              
136             =item * RT: CPAN request tracker
137              
138             L
139              
140             =item * AnnoCPAN: Annotated CPAN documentation
141              
142             L
143              
144             =item * Search CPAN
145              
146             L
147              
148             =back
149              
150             =head1 AUTHOR
151              
152             Yusuke Kawasaki, L
153              
154             =head1 SEE ALSO
155              
156             L and L
157              
158             =head1 COPYRIGHT
159              
160             Copyright 2009-2010 Yusuke Kawasaki, all rights reserved.
161              
162             =cut
163              
164             package Encode::JP::Emoji;
165 21     21   1095873 use strict;
  21         56  
  21         780  
166 21     21   114 use warnings;
  21         89  
  21         570  
167 21     21   14048 use Encode::JP::Emoji::PP;
  21         77  
  21         1263  
168              
169             our $VERSION = '0.60';
170              
171             1;