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. ๏ฟฝ

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

  4. NECKTIE U+1f454

  5. Agenda What is emoji? Why I โค emoji String encoding

    Ruby
  6. Emoji โ˜บ

  7. 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
  8. Emoji

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

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

  12. None
  13. None
  14. None
  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. ๏ฟฝ Strings

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

  25. 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.
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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"
  33. Basic Multilingual Plane

  34. 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
  35. User Input

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

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

  38. Rumoji

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

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

    | rumoji But Rumoji makes encoding issues a
  41. โ€ข 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
  42. โค