1=head1 NAME 2 3Encode::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 <SJIS+F89F> octets to DoCoMo UTF-8 <U+E63E> octets 11 my $sun = "\xF8\x9F"; 12 Encode::from_to($sun, 'x-sjis-emoji-docomo', 'utf8'); 13 14 # KDDI Shift_JIS <SJIS+F7F5> octets to SoftBank Shift_JIS <SJIS+F747> octets 15 my $scream = "\xF7\xF5"; 16 Encode::from_to($scream, 'x-sjis-e4u-kddiapp', 'x-sjis-e4u-softbank3g'); 17 18 # DoCoMo UTF-8 <U+E6E2> octets to Google UTF-8 <U+FE82E> octets 19 my $keycap1 = "\xEE\x9B\xA2"; 20 Encode::from_to($keycap1, 'x-utf8-e4u-docomo', 'utf8'); 21 22 # Google UTF-8 <U+FE001> string to KDDI Shift_JIS <SJIS+F7C5> octets 23 my $newmoon = "\x{FE011}"; 24 my $kddi = Encode::encode('x-sjis-e4u-kddiweb', $newmoon); 25 26 # SoftBank Shift_JIS <SJIS+F750> octets to SoftBank UTF-8 <U+E110> string 27 my $clover = "\xF7\x50"; 28 my $softbank = Encode::decode('x-sjis-emoji-softbank3g', $clover); 29 30=head1 DESCRIPTION 31 32This module provides encodings which support emoji picture characters. 33 34The first group of encodings uses carriers' private code points 35as 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 51KDDI has two version of thier private code points. 52KDDI(app) is official and documented version used in EZappli and character references. 53KDDI(web), on the other hand, is B<undocumented version> but used in UTF-8 web pages. 54Use KDDI(web) encoding recommended in most cases. 55 56SoftBank also has two version of thier emoji representations. 57SoftBank(2G) uses escape sequence style. 58SoftBank(3G) uses binary representations. 59Use SoftBank(3G) encoding recommended in most cases. 60 61The second group uses Googles's private code points internaly. 62This 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 78The cross-carriers mapping tables are based on emoji4unicode, 79Emoji for Unicode, project on Google Code. 80See more detail on L<http://code.google.com/p/emoji4unicode/> about the project. 81 82The 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 91C<x-utf8-e4u-unicode> encodes the Unicode 6.0 emojis. 92 93C<x-utf8-e4u-google> does B<NO> translations and exists only for useful. 94 95C<x-utf8-e4u-mixed> accepts all emojis of three mobile carriers mixed. 96On decoding, however, KDDI(app) emojis would be broken as they have conflicts 97with SoftBank emojis. So B<DO NOT> use KDDI(app) with this. 98On encoding, this replaces Google emojis to others definitively. 99This encoding is friendly for L<Encode::JP::Mobile> and MySQL 5.4. 100Note that MySQL before 5.5.3 does not support four bytes UTF-8 including 101both Google and Unicode Standard emojis. 102 103Tha last group rejects any emojis above. 104You would use these encodings with L<Encode::JP::Emoji::FB_EMOJI_TEXT> 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 116This module requires Perl version 5.8.1 or later. 117 118L<Unicode::Emoji::E4U> is not required on run time. 119 120=head1 LINKS 121 122=over 4 123 124=item * Subversion Trunk 125 126L<http://emoji4unicode-ll.googlecode.com/svn/trunk/lang/perl/Encode-JP-Emoji/trunk/> 127 128=item * Project Hosting on Google Code 129 130L<http://code.google.com/p/emoji4unicode-ll/> 131 132=item * Google Groups and some Japanese documents 133 134L<http://groups.google.com/group/emoji4unicode-ll> 135 136=item * RT: CPAN request tracker 137 138L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Encode-JP-Emoji> 139 140=item * AnnoCPAN: Annotated CPAN documentation 141 142L<http://annocpan.org/dist/Encode-JP-Emoji> 143 144=item * Search CPAN 145 146L<http://search.cpan.org/dist/Encode-JP-Emoji/> 147 148=back 149 150=head1 AUTHOR 151 152Yusuke Kawasaki, L<http://www.kawa.net/> 153 154=head1 SEE ALSO 155 156L<Encode> and L<Unicode::Emoji::E4U> 157 158=head1 COPYRIGHT 159 160Copyright 2009-2010 Yusuke Kawasaki, all rights reserved. 161 162=cut 163 164package Encode::JP::Emoji; 165use strict; 166use warnings; 167use Encode::JP::Emoji::PP; 168 169our $VERSION = '0.60'; 170 1711; 172