GithubHelp home page GithubHelp logo

global19-atlassian-net / rumoji Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itskoko/rumoji

0.0 1.0 0.0 95 KB

Encode and decode emoji unicode characters into emoji-cheat-sheet form.

Home Page: http://mwunsch.tumblr.com/post/34721548842/we-need-to-talk-about-emoji

License: MIT License

Ruby 100.00%

rumoji's Introduction

Rumoji

This is a tool to convert Emoji Unicode codepoints into the human-friendly codes used by http://www.emoji-cheat-sheet.com/ and back again.

Why would you want to do this? Read this blog post: http://mwunsch.tumblr.com/post/34721548842/we-need-to-talk-about-emoji

tl;dr

By doing this, you can ensure that users across devices can see the authorโ€™s intention. You can always show users an image, but you canโ€™t show them a range of characters their system does not support.

This gem is primarily for handling emoji characters in user-generated content. Depending on your technical stack, these characters could end up being lost.

Usage

Rumoji.encode(str)
# Takes a String, transforms Emoji into cheat-sheet codes

Rumoji.decode(str)
# Does the reverse

Rumoji.encode_io(read, write)
# For an IO pipe (a read stream, and a write stream), transform Emoji from the
# read end, and write the cheat-sheet codes on the write end.

Rumoji.decode_io(read, write)
# Same thing but in reverse!

Installation

gem install rumoji

Note that rumoji has only been tested in Rubies >= 1.9!!!

Some examples:

puts Rumoji.encode("Lack of cross-device emoji support makes me ๐Ÿ˜ญ")

#=> Lack of cross-device emoji support makes me :sob:

Here's a fun file:

Rumoji.decode_io($stdin, $stdout)

On the command line

echo "But Rumoji makes encoding issues a :joy:" | ruby ./funfile.rb
#=> But Rumoji makes encoding issues a ๐Ÿ˜‚

Implement the emoji codes from emoji-cheat-sheet.com using a tool like gemoji along with Rumoji, and you'll easily be able to transform user input with raw emoji unicode into images you can show to all users.

Having trouble discerning what's happening in this README? You might be on a device with NO emoji support! All the more reason to use Rumoji. Transcode the raw unicode into something users can understand across devices!

Thanks!

Copyright

Copyright (c) 2012 - 2016 Mark Wunsch. Licensed under the MIT License.

rumoji's People

Contributors

bgentry avatar cantino avatar chrismaximin avatar eyalkenig avatar kareemk avatar kindjar avatar mwunsch avatar remi avatar rockin1208 avatar tiff avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.