Skip to content

Instantly share code, notes, and snippets.

@tmtysk
Created December 26, 2009 17:41
Show Gist options
  • Save tmtysk/263992 to your computer and use it in GitHub Desktop.
Save tmtysk/263992 to your computer and use it in GitHub Desktop.
emoji4unicode のデータと Unicode::Emoji::E4U を使って、SoftBank の SJIS-Unicode 変換テーブル(jpmobileフォーマット)を作成する
use Unicode::Emoji::E4U;
binmode(STDOUT, ":utf8");
my $e4u = Unicode::Emoji::E4U->new;
# fetch data files from Google Code (default)
$e4u->datadir('http://emoji4unicode.googlecode.com/svn/trunk/data/');
my $softbank = $e4u->softbank; # Unicode::Emoji::Google instance
print "Jpmobile::Emoticon::SOFTBANK_SJIS_TO_UNICODE = {\n";
foreach $e (@{$softbank->list}) {
my $se = $e->softbank_emoji;
print " 0x", uc(unpack("H*", $se->cp932_octets)), " => 0x", $e->unicode, ",\n";
}
print "}\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment