Emoji Ruby
Quickly access emoji Unicode characters across all 4 implementations in the private-use character space.
An Overview
From Wikipedia: “Emoji is the Japanese term for the picture characters or emoticons used in Japanese wireless messages and webpages.”
They are the tiny little pictures that gained quite a bit of attention outside of Japan once they were included in the iPhone 2.2 firmware. Sounds awesome right? Wrong.
There are 3 carriers (NTT DoCoMo, SoftBank & Au by KDDI) who’ve all created they own set of emoji glyphs in differing areas of the private-use range Unicode character space. Basic emoji supports 176 glyphs plus an additional 76 for C-HTML 4.0 for a total of 252. The iPhone—which uses the SoftBank implementation—supports 471 emoji glyphs and to top it off, Apple and Google have been working on a standards proposal for inclusion in ISO/IEC 10646 which proposes 722 glyphs in total. Confused yet? Right then.
With millions of mobile phones supporting emoji & Internet connections, web developers want to take advantage of the extended glyphs in the data they send to the mobile devices but in the Ruby community there doesn’t seem to be a clear library that implements all 4 standards. Enter the Emoji for Ruby.
I’ve based the methods names off the Apple + Google Emoji encoding proposal (see chart at: www.bitcontrol.org/emoji-ruby) because I believe it has a fighting chance of being adopted (…and I’m biased).
Installing Emoji Ruby
You may get the latest stable version from RubyForge.
$ gem install emoji
Emoji Ruby is still under active development, you can get the latest source from emoji.rubyforge.org
Specifics
The Emoji Ruby Homepage is hosted on RubyForge at: emoji.rubyforge.org and a nice emoji/unicode table for the iPhone is at: www.bitcontrol.org/emoji-ruby
Examples
To create an emoji instance:
require 'emoji'
e = Emoji.create(:iphone)
Other supported character mappings include:
require 'emoji'
softbank_emoji = Emoji.create(:softbank)
iphone_emoji = Emoji.create(:iphone) #Same character space impl as SoftBank
ntt_docomo_emoji = Emoji.create(:docomo)
kddi_emoji = Emoji.create(:kddi)
au_emoji = Emoji.create(:au) #Synonym for KDDI
apple_google_emoji = Emoji.create(:google)
Returning an Emoji character:
require 'emoji'
cloud = Emoji.create(:iphone).cloud
puts cloud
# Or...
e = Emoji.create(:softbank)
puts "Yo... I'll be there shortly—stopping at #{e.atm}"
List of all the emoji methods implemented
black_sun_with_rays
cloud
umbrella_with_rain_drops
snowman_without_snow
high_voltage_sign
cyclone
foggy
closed_umbrella
night_with_stars
sunrise_over_mountains
sunrise
cityscape_at_dusk
sunset_over_buildings
rainbow
snowflake
sun_behind_cloud
bridge_at_night
new_moon_symbol
waxing_gibbous_moon_symbol
first_quarter_moon_symbol
crescent_moon
full_moon_symbol
first_quarter_moon_with_face
soon_with_right_arrow_above
on_with_double_pointing_arrow_above
end_with_left_arrow_above
hourglass_with_flowing_sand
hourglass
watch
clock_face_one_oclock
clock_face_two_oclock
clock_face_three_oclock
clock_face_four_oclock
clock_face_five_oclock
clock_face_six_oclock
clock_face_seven_oclock
clock_face_eight_oclock
clock_face_nine_oclock
clock_face_ten_oclock
clock_face_eleven_oclock
clock_face_twelve_oclock
alarm_clock
aries
taurus
gemini
cancer
leo
virgo
libra
scorpius
sagittarius
capricorn
aquarius
pisces
ophiuchus
water_wave
earth_globe_asia_australia
volcano
milky_way
four_leaf_clover
tulip
seedling
maple_leaf
cherry_blossom
rose
fallen_leaf
leaf_fluttering_in_wind
hibiscus
sunflower
palm_tree
cactus
ear_of_rice
ear_of_maize
mushroom
chestnut
blossom
herb
cherries
banana
apple_1
tangerine
strawberry
watermelon
tomato
aubergine
melon
pineapple
grapes
peach
apple_2
eyes
ear
nose
mouth
tongue
lipstick
nail_care
face_massage
haircut
barber_pole
bust_in_silhouette
boys_head
girls_head
mans_head
womans_head
family
couple
police_officer
woman_with_bunny_ears
bride_with_veil
western_person
man_with_gua_pi_mao
man_with_turban
older_man
older_woman
baby
construction_worker
princess
ogre
goblin
ghost
cherub
extraterrestrial_alien
alien_monster
imp
skull
information_desk_person
guardsman
dancer
dog_face
cat_face
snail
baby_chick
front_facing_baby_chick
hatching_chick
penguin
fish
horse_face
pig_face
tiger_face
bear_face
mouse_face
spouting_whale
monkey_face
octopus
spiral_shell
dolphin
bird
tropical_fish
hamster_face
bug
elephant
koala
monkey
sheep
wolf_face
cow_face
rabbit_face
snake
chicken
boar
camel
frog_face
poodle
blowfish
ant
paw_prints
turtle
dragon_face
panda_face
pig_nose
honeybee
ladybug
angry_face
anguished_face
astonished_face
disappointed_face
dizzy_face
exasperated_face
expressionless_face
face_with_heart_shaped_eyes
face_with_look_of_triumph
winking_face_with_stuck_out_tongue
face_with_stuck_out_tongue
face_savoring_delicious_food
face_throwing_a_kiss
face_kissing
face_with_mask
flushed_face
happy_face_with_open_mouth
happy_face_with_open_mouth_and_cold_sweat
happy_face_with_open_mouth_and_closed_eyes
happy_face_with_grin
happy_and_crying_face
happy_face_with_wide_mouth_and_raised_eyebrows
white_smiling_face
happy_face_with_open_mouth_and_raised_eyebrows
crying_face
loudly_crying_face
fearful_face
persevering_face
pouting_face
relieved_face
confounded_face
pensive_face
face_screaming_in_fear
sleepy_face
smirking_face
face_with_cold_sweat
disappointed_but_relieved_face
tired_face
winking_face
cat_face_with_open_mouth
happy_cat_face_with_grin
happy_and_crying_cat_face
cat_face_kissing
cat_face_with_heart_shaped_eyes
crying_cat_face
pouting_cat_face
cat_face_with_tightly_closed_lips
anguished_cat_face
face_with_no_good_gesture
face_with_ok_gesture
person_bowing_deeply
see_no_evil_monkey
speak_no_evil_monkey
hear_no_evil_monkey
person_raising_one_hand
person_raising_both_hands_in_cheers
person_frowning
person_with_pouting_face
person_with_folded_hands
house_building
house_with_yard
office_building
japanese_post_office
hospital
bank
atm
hotel
love_hotel
convenience_store
school
church
fountain
department_store
japanese_castle
western_castle
factory
anchor
izakaya_lantern
emoji_compatibility_symbol_1
emoji_compatibility_symbol_2
emoji_compatibility_symbol_3
emoji_compatibility_symbol_4
emoji_compatibility_symbol_5
wrench
hammer
nut_and_bolt
mans_shoe
sneaker
high_heeled_shoe
womans_sandal
womans_boots
eyeglasses
t_shirt
jeans
crown
necktie
womans_hat
dress
kimono
bikini
womans_clothes
purse
money_bag
currency_exchange
chart_with_upwards_trend_and_yen_symbol
heavy_dollar_sign
credit_card
banknote_with_yen_sign
banknote_with_dollar_sign
money_with_wings
emoji_compatibility_symbol_6
emoji_compatibility_symbol_7
emoji_compatibility_symbol_8
emoji_compatibility_symbol_9
emoji_compatibility_symbol_10
emoji_compatibility_symbol_11
emoji_compatibility_symbol_12
emoji_compatibility_symbol_13
emoji_compatibility_symbol_14
emoji_compatibility_symbol_15
camera
handbag
pouch
bell
door
dung
pistol
fire
crystal_ball
six_pointed_star_with_middle_dot
video_camera
knife
flashlight
battery
scroll
electric_plug
book_1
book_2
book_3
vertical_closed_book
books
name_badge
bath
restroom
toilet
water_closet
syringe
pill
negative_squared_latin_capital_letter_a
negative_squared_latin_capital_letter_b
negative_squared_ab
negative_squared_latin_capital_letter_o
ribbon
wrapped_present
birthday_cake
christmas_tree
santa_claus
crossed_flags
fireworks
balloon
party_popper
pine_decoration
girls_doll_festival
graduation_cap
school_satchel
carp_streamer
firework_sparkler
wind_chime
jack_o_lantern
confetti_ball
tanabata_tree
moon_viewing_ceremony
pager
black_telephone
telephone_receiver
mobile_phone
phone_with_arrow
memo
fax
envelope
incoming_envelope
envelope_with_arrow
mailbox
mailbox_with_raised_flag
postbox
public_address_loudspeaker
cheering_megaphone
satellite_antenna
speech_balloon
outbox_tray
inbox_tray
package
latin_capital_letters_input_symbol
latin_small_letters_input_symbol
numbers_input_symbol
symbols_input_symbol
latin_letters_input_symbol
black_nib
seat
computer
pencil
paperclip
briefcase
mini_disc
floppy_disk
black_scissors
round_pushpin
page_with_curl
page_facing_up
calendar
file_folder
open_file_folder
notebook
open_book
notebook_with_decorative_cover
clipboard
tear_off_calendar
bar_chart
chart_with_upwards_trend
chart_with_downwards_trend
card_index
pushpin
ledger
straight_ruler
triangular_ruler
bookmark_tabs
footprints
running_shirt_with_sash
baseball
flag_in_hole
tennis
soccer_ball
skiing
basketball
checkered_flag
snowboarder
runner
surfer
trophy
horse_racing
american_football
swimmer
train
subway
circled_latin_capital_letter_m
high_speed_train
high_speed_train_with_bullet_nose
automobile_1
recreational_vehicle
bus_2
bus_stop
ship
airplane
sailboat
bicycle
station
rocket
speedboat
taxi_1
pedestrian
truck
fire_engine
ambulance
police_car_1
fuel_pump
negative_squared_latin_capital_letter_p
horizontal_traffic_light
construction_sign
police_cars_revolving_light
hot_springs
tent
carousel_horse
ferris_wheel
roller_coaster
fishing
microphone
movies
cinema
headphone
art
top_hat
event
ticket
movie_shooting_clapboard
performing_arts
video_game
mahjong_tile_red_dragon
direct_hit
slot_machine
billiards
game_die
bowling
flower_playing_cards
playing_card_black_joker
musical_note
multiple_musical_notes
saxophone
guitar
musical_keyboard
trumpet
violin
musical_score
part_alternation_mark
television
optical_disk
dvd
radio
video_cassette_tape
speaker_with_three_sound_waves
newspaper
kiss_mark
love_letter
ring
gem_stone
kiss
bouquet
couple_with_heart
wedding
hash_key
keycap_1
keycap_2
keycap_3
keycap_4
keycap_5
keycap_6
keycap_7
keycap_8
keycap_9
keycap_0
keycap_ten
antenna_with_bars
vibration_mode
mobile_phone_off
hamburger
rice_ball
shortcake
steaming_bowl
bread
cooking
soft_ice_cream
french_fries
dumpling
rice_cracker
cooked_rice
spaghetti
curry_and_rice
seafood_casserole
sushi
lunchbox
pot_of_food
shaved_ice
meat_on_bone
fish_cake_with_swirl_design
roasted_sweet_potato
slice_of_pizza
poultry_leg
ice_cream
doughnut
cookie
chocolate_bar
candy
lollipop
custard
honey_pot
fried_shrimp
fork_and_knife
hot_beverage
cocktail_glass
beer_mug
teacup_without_handle
sake_bottle_and_cup
wine_glass
clinking_beer_mugs
tropical_drink
north_east_arrow
south_east_arrow
north_west_arrow
south_west_arrow
arrow_pointing_rightwards_then_curving_upwards
arrow_pointing_rightwards_then_curving_downwards
left_right_arrow
up_down_arrow
upwards_black_arrow
downwards_black_arrow
black_rightwards_arrow
leftwards_black_arrow
black_right_pointing_triangle
black_left_pointing_triangle
black_right_pointing_double_triangle
black_left_pointing_double_triangle
black_up_pointing_double_triangle
black_down_pointing_double_triangle
up_pointing_triangle_1
down_pointing_triangle_1
up_pointing_small_triangle_1
down_pointing_small_triangle_1
heavy_exclamation_mark_ornament
exclamation_question_mark
double_exclamation_mark
black_question_mark_ornament
white_question_mark_ornament
white_exclamation_mark_ornament
wavy_dash
looped_length_mark
heavy_black_heart
beating_heart
broken_heart
two_hearts
sparkling_heart
growing_heart
heart_with_arrow
heart_1
heart_2
heart_3
heart_4
heart_with_ribbon
revolving_hearts
heart_decoration
black_heart_suit
black_spade_suit
black_diamond_suit
black_club_suit
smoking_symbol
no_smoking_symbol
wheelchair_symbol
japanese_symbol_for_beginner
trident_emblem
triangular_flag_on_post
warning_sign
no_entry
black_universal_recycling_symbol
mens_symbol
womens_symbol
baby_symbol
heavy_large_circle
cross_mark
negative_squared_cross_mark
no_entry_sign
heavy_check_mark
white_heavy_check_mark
link_symbol
em_space
en_space
four_per_em_space
free_sign
no_one_under_eighteen_sign
ok_sign
no_good_sign
copyright_sign
registered_sign
trade_mark_sign
vs_sign
new_sign
up_sign
cool_sign
top_with_up_pointing_triangle_sign
information_source
sos_sign
squared_katakana_koko
squared_katakana_sa
squared_cjk_unified_ideograph_7981
squared_cjk_unified_ideograph_7a7a
squared_cjk_unified_ideograph_5408
squared_cjk_unified_ideograph_6e80
squared_cjk_unified_ideograph_6709
squared_cjk_unified_ideograph_7121
squared_cjk_unified_ideograph_6708
squared_cjk_unified_ideograph_7533
squared_cjk_unified_ideograph_5272
squared_cjk_unified_ideograph_6307
squared_cjk_unified_ideograph_55b6
circled_ideograph_secret
circled_ideograph_congratulation
circled_ideograph_advantage
circled_ideograph_accept
heavy_plus_sign
heavy_minus_sign
heavy_multiplication_x
heavy_division_sign
diamond_shape_with_a_dot_inside
electric_light_bulb
anger_sign
bomb
sleeping_sign
collision_symbol
splashing_sweat
drip
dash_symbol
flexed_bicep
dizzy_symbol
sparkles
eight_pointed_black_star
eight_spoked_asterisk
medium_white_circle
medium_black_circle
large_circle_1
large_circle_2
black_rounded_square
white_rounded_square
white_medium_star
glowing_star
shooting_star
white_large_square
black_large_square
white_small_square
black_small_square
white_medium_small_square
black_medium_small_square
white_medium_square
black_medium_square
large_diamond_1
large_diamond_2
small_diamond_1
small_diamond_2
sparkle
white_flower
hundred_points_symbol
identification_sign
clear_sign
leftwards_arrow_with_hook
rightwards_arrow_with_hook
left_pointing_magnifying_glass
right_pointing_magnifying_glass
lock
open_lock
lock_with_ink_pen
closed_lock_with_key
key
ballot_box_with_check
radio_button
back_with_left_arrow_above
bookmark
double_clockwise_open_circle_arrows
e_mail_symbol
raised_fist
raised_hand
victory_hand
fisted_hand
thumbs_up_sign
white_up_pointing_index
white_up_pointing_backhand_index
white_down_pointing_backhand_index
white_left_pointing_backhand_index
white_right_pointing_backhand_index
waving_hand
clapping_hands
ok_hand_sign
thumbs_down_sign
open_hands