Created
June 27, 2011 05:16
-
-
Save mix3/1048343 to your computer and use it in GitHub Desktop.
MobaSiF用絵文字変換
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| my $KEY2SJIS = { | |
| 'sun' => 'F89F', | |
| 'cloud' => 'F8A0', | |
| 'rain' => 'F8A1', | |
| 'snowman' => 'F8A2', | |
| 'bolt' => 'F8A3', | |
| 'typhoon' => 'F8A4', | |
| 'mist' => 'F8A5', | |
| 'umbrella' => 'F8A6', | |
| 'aries' => 'F8A7', | |
| 'taurus' => 'F8A8', | |
| 'gemini' => 'F8A9', | |
| 'cancer' => 'F8AA', | |
| 'leo' => 'F8AB', | |
| 'virgo' => 'F8AC', | |
| 'libra' => 'F8AD', | |
| 'scorpio' => 'F8AE', | |
| 'sagittarius' => 'F8AF', | |
| 'capricorn' => 'F8B0', | |
| 'aquarius' => 'F8B1', | |
| 'pisces' => 'F8B2', | |
| 'marathon' => 'F9D8', | |
| 'baseball' => 'F8B4', | |
| 'golf' => 'F8B5', | |
| 'tennis' => 'F8B6', | |
| 'soccer' => 'F8B7', | |
| 'skis' => 'F8B8', | |
| 'basketball' => 'F8B9', | |
| 'checkerflag' => 'F8BA', | |
| 'pager' => 'F8BB', | |
| 'train' => 'F8BC', | |
| 'subway' => 'F8BD', | |
| 'superexpress' => 'F8BE', | |
| 'car_sedan' => 'F8BF', | |
| 'car_rv' => 'F8C0', | |
| 'bus' => 'F8C1', | |
| 'ship' => 'F8C2', | |
| 'plane' => 'F8C3', | |
| 'house' => 'F8C4', | |
| 'factory' => 'F8C5', | |
| 'postoffice' => 'F8C6', | |
| 'hospital' => 'F8C7', | |
| 'bank' => 'F8C8', | |
| 'atm' => 'F8C9', | |
| 'hotel' => 'F8CA', | |
| '24hours' => 'F8CB', | |
| 'gasstation' => 'F8CC', | |
| 'parking' => 'F8CD', | |
| 'trafficlight' => 'F8CE', | |
| 'toilet' => 'F8CF', | |
| 'meal1' => 'F8D0', | |
| 'cup' => 'F8D1', | |
| 'martini' => 'F8D2', | |
| 'mug' => 'F8D3', | |
| 'hamburger' => 'F8D4', | |
| 'shoe' => 'F8D5', | |
| 'scissors' => 'F8D6', | |
| 'microphone' => 'F8D7', | |
| 'camcorder' => 'F8D8', | |
| 'rightarrow2' => 'F8D9', | |
| 'amusementpark' => 'F8DA', | |
| 'headphone' => 'F8DB', | |
| 'art' => 'F8DC', | |
| 'drama' => 'F8DD', | |
| 'event' => 'F8DE', | |
| 'ticket' => 'F8DF', | |
| 'smoking' => 'F8E0', | |
| 'nosmoking' => 'F8E1', | |
| 'camera1' => 'F8E2', | |
| 'briefcase' => 'F8E3', | |
| 'book1' => 'F8E4', | |
| 'ribbon' => 'F8E5', | |
| 'present' => 'F8E6', | |
| 'birthday' => 'F8E7', | |
| 'phone1' => 'F8E8', | |
| 'phone3' => 'F8E9', | |
| 'document1' => 'F8EA', | |
| 'tv' => 'F8EB', | |
| 'controller' => 'F8EC', | |
| 'cd' => 'F8ED', | |
| 'heart' => 'F8EE', | |
| 'spade' => 'F8EF', | |
| 'diamond' => 'F8F0', | |
| 'clover' => 'F8F1', | |
| 'eye' => 'F8F2', | |
| 'ear' => 'F8F3', | |
| 'closefinger' => 'F8F4', | |
| 'peacesign' => 'F8F5', | |
| 'openfinger' => 'F8F6', | |
| 'downarrow2' => 'F8F7', | |
| 'uparrow2' => 'F8F8', | |
| 'footmark' => 'F8F9', | |
| 'sneakers' => 'F8FA', | |
| 'glasses' => 'F8FB', | |
| 'wheelchair' => 'F8FC', | |
| 'moon3' => 'F940', | |
| 'moon4' => 'F941', | |
| 'moon5' => 'F942', | |
| 'moon1' => 'F943', | |
| 'moon2' => 'F944', | |
| 'dog' => 'F945', | |
| 'cat' => 'F946', | |
| 'boat' => 'F947', | |
| 'christmastree' => 'F948', | |
| 'leftarrow2' => 'F949', | |
| 'exit' => 'F972', | |
| 'envelope4' => 'F973', | |
| 'fax_to' => 'F974', | |
| 'info' => 'F975', | |
| 'carrier1' => 'F975', | |
| 'carrier2' => 'F976', | |
| 'envelope1' => 'F977', | |
| 'carrier3' => 'F978', | |
| 'carrier4' => 'F979', | |
| 'check' => 'F97A', | |
| 'freesign' => 'F97B', | |
| 'mark3' => 'F97C', | |
| 'key' => 'F97D', | |
| 'roundarrow2' => 'F97E', | |
| 'clear' => 'F980', | |
| 'magnifyglass' => 'F981', | |
| 'search' => 'F981', | |
| 'new' => 'F982', | |
| 'flag3' => 'F983', | |
| 'freedial' => 'F984', | |
| 'sharp' => 'F985', | |
| 'question2' => 'F986', | |
| '1square' => 'F987', | |
| '2square' => 'F988', | |
| '3square' => 'F989', | |
| '4square' => 'F98A', | |
| '5square' => 'F98B', | |
| '6square' => 'F98C', | |
| '7square' => 'F98D', | |
| '8square' => 'F98E', | |
| '9square' => 'F98F', | |
| '0square' => 'F990', | |
| 'okay' => 'F9B0', | |
| 'heart0' => 'F991', | |
| 'lovely' => 'F992', | |
| 'heart2' => 'F993', | |
| 'heart3' => 'F994', | |
| 'face1' => 'F995', | |
| 'face2' => 'F996', | |
| 'face4' => 'F997', | |
| 'face3' => 'F998', | |
| 'face5' => 'F999', | |
| 'uparrow3' => 'F99A', | |
| 'melody2' => 'F99B', | |
| 'hotspring' => 'F99C', | |
| 'littlediamond1' => 'F99D', | |
| 'kissmark' => 'F99E', | |
| 'sparkle2' => 'F99F', | |
| 'lightbulb' => 'F9A0', | |
| 'anger' => 'F9A1', | |
| 'punch' => 'F9A2', | |
| 'bomb' => 'F9A3', | |
| 'melody' => 'F9A4', | |
| 'downarrow3' => 'F9A5', | |
| 'sleepy' => 'F9A6', | |
| 'exclamation2' => 'F9A7', | |
| 'question' => 'F9A8', | |
| 'sign2' => 'F9A8', | |
| 'sign3' => 'F9A9', | |
| 'impact' => 'F9AA', | |
| 'sweat' => 'F9AB', | |
| 'drip' => 'F9AC', | |
| 'dash' => 'F9AD', | |
| 'waveline' => 'F9AE', | |
| 'sign4' => 'F9AF', | |
| 'movie' => 'F950', | |
| 'pouch' => 'F951', | |
| 'win' => 'F951', | |
| 'edit' => 'F952', | |
| 'head1' => 'F955', | |
| 'chair' => 'F956', | |
| 'nightbridge' => 'F957', | |
| 'rightarrow1' => 'F95B', | |
| 'on' => 'F95C', | |
| 'leftarrow1' => 'F95D', | |
| 'clock' => 'F95E', | |
| 'mensfashion' => 'F9B3', | |
| 'tshirt' => 'F9B3', | |
| 'wallet' => 'F9B4', | |
| 'rouge' => 'F9B5', | |
| 'jeans' => 'F9B6', | |
| 'snowboard' => 'F9B7', | |
| 'bell' => 'F9B8', | |
| 'point' => 'F9BA', | |
| 'pc' => 'F9BB', | |
| 'envelope3' => 'F9BC', | |
| 'wrench' => 'F9BD', | |
| 'pencil' => 'F9BE', | |
| 'crown' => 'F9BF', | |
| 'gem' => 'F9C0', | |
| 'hourglass2' => 'F9C1', | |
| 'bicycle' => 'F9C2', | |
| 'japanesetea' => 'F9C3', | |
| 'wristwatch' => 'F9C4', | |
| 'face9' => 'F9C5', | |
| 'face14' => 'F9C6', | |
| 'face8' => 'F9C7', | |
| 'face7' => 'F9C8', | |
| 'face26' => 'F9C9', | |
| 'face18' => 'F9CA', | |
| 'face6' => 'F9CB', | |
| 'good' => 'F9CC', | |
| 'thumbsign' => 'F9CC', | |
| 'kidding' => 'F9CD', | |
| 'wink' => 'F9CE', | |
| 'surprise' => 'F9CF', | |
| 'face15' => 'F9CF', | |
| 'face11' => 'F9D0', | |
| 'face33' => 'F9D1', | |
| 'face30' => 'F9D2', | |
| 'face29' => 'F9D3', | |
| 'ng' => 'F9D4', | |
| 'paperclip' => 'F9D5', | |
| 'copyright' => 'F9D6', | |
| 'trademark' => 'F9D7', | |
| 'secretsign' => 'F9D9', | |
| 'arrow' => 'F9DA', | |
| 'registered' => 'F9DB', | |
| 'exclamation1' => 'F9DC', | |
| 'alert' => 'F9DC', | |
| 'mark5' => 'F9DE', | |
| 'mark4' => 'F9E0', | |
| 'doubleheadedarrow' => 'F9E1', | |
| 'doubleheadedarrow2' => 'F9E2', | |
| 'school' => 'F9E3', | |
| 'wave' => 'F9E4', | |
| 'fuji' => 'F9E5', | |
| 'fujisan' => 'F9E5', | |
| 'bud' => 'F9E6', | |
| 'cherry' => 'F9E7', | |
| 'flower' => 'F9E8', | |
| 'banana' => 'F9E9', | |
| 'apple' => 'F9EA', | |
| 'bud2' => 'F9EB', | |
| 'leaf' => 'F9EC', | |
| 'cherryblossoms' => 'F9ED', | |
| 'riceball' => 'F9EE', | |
| 'cake' => 'F9EF', | |
| 'sakebottle' => 'F9F0', | |
| 'noodle' => 'F9F1', | |
| 'bread' => 'F9F2', | |
| 'snail' => 'F9F3', | |
| 'bird' => 'F9F4', | |
| 'penguin' => 'F9F5', | |
| 'fish' => 'F9F6', | |
| 'face21' => 'F9F7', | |
| 'face31' => 'F9F8', | |
| 'horse' => 'F9F9', | |
| 'pig' => 'F9FA', | |
| 'wineglass' => 'F9FB', | |
| 'shock' => 'F9FC', | |
| 'back' => 'F97E', | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- pm/MobileTplCompiler.pm.orig 2011-06-27 14:10:08.000000000 +0900 | |
| +++ pm/MobileTplCompiler.pm 2011-06-27 14:11:08.000000000 +0900 | |
| @@ -180,6 +180,8 @@ | |
| my $saveFile = "$saveDir/$name.bin.$type"; | |
| my $text = readFile($srcName, $type); | |
| + $text = replace_emoji($text); | |
| + | |
| my $mtime2 = get_mtime($saveFile); | |
| return if ($mtime < $mtime2); | |
| @@ -545,4 +547,19 @@ | |
| (stat($filename))[9]; | |
| } | |
| +sub emoji { | |
| + my $input = shift; | |
| + $input =~ s/'|\s//g; | |
| + my ($key, $color) = split(/,/, $input); | |
| + my $bi = pack 'n', hex $_::KEY2SJIS->{$key}; | |
| + return '<span style="'.$color.'">'.$bi.'</span>' if($color); | |
| + return $bi; | |
| +} | |
| + | |
| +sub replace_emoji { | |
| + my $html = shift; | |
| + $html =~ s/emoji\('(.+?)'\)/emoji($1)/eg; | |
| + return $html; | |
| +} | |
| + | |
| 1; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<html>
<body>
emoji('back')<br />
emoji('cherryblossoms', '#FF0000')<br />
</body>
</html>