Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Emoji is Serious Business 👔

Emoji is Serious Business 👔

Discussing cross-platform issues that arise with emoji, and how you can suport emoji input and display in your application with minimum fuss. Along the way, addressing Ruby String encoding, Unicode, and the pains of managing user input.

63e2f6b0de6ae817af2e185b82aa05c2?s=128

Mark Wunsch

April 09, 2013
Tweet

Transcript

  1. None
  2. Emoji is serious business Mark Wunsch @markwunsch markwunsch.com

  3. NECKTIE U+1f454

  4. Agenda What is emoji? Why I ❤ emoji String encoding

    Ruby
  5. Emoji ☺

  6. http://www.theverge.com/2013/3/4/3966140/how-emoji-conquered-the-world The promise of digital communication — being able to

    stay in closer touch with people — was being offset by this accompanying increase in miscommunication
  7. Emoji

  8. http://www.unicode.org/~scherer/emoji4unicode/snapshot/full.html

  9. None
  10. http://narrativesinemoji.tumblr.com/

  11. None
  12. None
  13. None
  14. None
  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. � Strings

  23. There Ain't No Such Thing As Plain Text. http://www.joelonsoftware.com/articles/Unicode.html

  24. OD(1) BSD General Commands Manual OD(1) NAME od -- octal,

    decimal, hex, ASCII dump SYNOPSIS od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] DESCRIPTION The od utility is a filter which displays the specified files, or standard input if no files are specified, in a user specified format.
  25. mark:~ $ echo 'Hello, world' | od -cs 0000000 H

    e l l o , w o r l d \n 25928 27756 11375 30496 29295 25708 10 0000015
  26. irb(main):001:0> hello = %w( 25928 27756 11375 30496 29295 25708

    10 ).map(&:to_i) => [25928, 27756, 11375, 30496, 29295, 25708, 10] irb(main):002:0> hello.pack("s*") => "Hello, world\n\x00" Array#pack
  27. mark:~ $ echo 'Hello, world' | od -c -txC 0000000

    H e l l o , w o r l d \n 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 0a 0000015
  28. irb(main):001:0> hex = %w( 48 65 6c 6c 6f 2c

    20 77 6f 72 6c 64 0a ) => ["48", "65", "6c", "6c", "6f", "2c", "20", "77", "6f", "72", "6c", "64", "0a"] irb(main):002:0> hex.map(&:hex).pack("U*") => "Hello, world\n" Array#pack
  29. irb(main):001:0> hello = "Hello, world\n" => "Hello, world\n" irb(main):002:0> hello.unpack("U*").map

    {|fixnum| fixnum.to_s(16) } => ["48", "65", "6c", "6c", "6f", "2c", "20", "77", "6f", "72", "6c", "64", "a"] String#unpack
  30. mark:~ $ echo 'Hello, ' | od -c -txC 0000000

    H e l l o , 360 237 214 216 \n 48 65 6c 6c 6f 2c 20 f0 9f 8c 8e 0a 0000014
  31. irb(main):001:0> emoji = %w( 48 65 6c 6c 6f 2c

    20 f0 9f 8c 8e 0a ) => ["48", "65", "6c", "6c", "6f", "2c", "20", "f0", "9f", "8c", "8e", "0a"] irb(main):002:0> emoji.map(&:hex).pack("U*") => "Hello, ð\u009F\u008C\u008E\n"
  32. Basic Multilingual Plane

  33. irb(main):001:0> emoji = "Hello, \u{1F30E}" => "Hello, " irb(main):002:0> emoji.codepoints.map

    {|int| int.to_s(16) } => ["48", "65", "6c", "6c", "6f", "2c", "20", "1f30e"] irb(main):003:0> emoji.codepoints.to_a.pack("U*") => "Hello, " String#codepoints
  34. User Input

  35. U+2028 http://timelessrepo.com/json-isnt-a-javascript-subset

  36. https://github.com/blog/1311-html-pipeline-chainable-content-filters

  37. Rumoji

  38. puts Rumoji.encode("Lack of cross-device emoji support makes me ") #=>

    Lack of cross-device emoji support makes me :sob:
  39. mark:~ $ echo "But Rumoji makes encoding issues a :joy:"

    | rumoji But Rumoji makes encoding issues a
  40. • https://gist.github.com/ mwunsch/4710561 • https://github.com/tenderlove/ minitest-emoji • https://gist.github.com/ mwunsch/4691580 •

    http://zachholman.com/posts/ abusing-emoji/ • http://notes.torrez.org/2013/04/ put-a-burger-in-your-shell.html Extras