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

楽しい文字コード入門 知っておきたいUnicode Emoji編

楽しい文字コード入門 知っておきたいUnicode Emoji編

Bizreach Tech Beer Bashでの発表資料です

9aba2147bb6e43333fcc42e2afc570f2?s=128

Shunsuke Tadokoro

September 29, 2016
Tweet

Transcript

  1. CUCC ฏ੒ੜ·Εͷ จࣈίʔυೖ໳  #J[SFBDI5FDI#FFS#BTI !UPEPLS ஌͓͖͍ͬͯͨ 6OJDPEF&NPKJฤ ָ͍͠ʂ

  2. CUCC

  3. CUCC ୭ͩ

  4. CUCC ాॴ ॣ༎ !UPEPLS ⦁גࣜձࣾϏζϦʔν ελϯόΠࣄۀ෦ 
αʔνίΞάϧʔϓ ⦁৽ถ4DBMBΤϯδχΞ ⦁8FCΫϩʔϥʔͷ։ൃɾӡ༻ ⦁೥݄ೖࣾ

    
৽ଔ೥໨ ⦁ฏ੒೥ੜ·Ε ࡀ
  5. CUCC ͓࿩͢͠Δ͜ͱ • จࣈίʔυʁ • 6OJDPEF&NPKJͱͦͷྺ࢙ • ࡢࠓͷ&NPKJࣄ৘ • ϓϩάϥϜ͔Βѻ͏

  6. CUCC αʔνίΞάϧʔϓ ٻਓαΠτΫϩʔϥʔͷ։ൃͱӡ༻ ΫϩʔϦϯάͱจࣈίʔυ Ϋϩʔϥʔ ٻਓαΠτ ٻ৬ऀ ΫϩʔϦϯά ΠϯσΩγϯά ٻਓݕࡧ

  7. CUCC Ṗͷ63-Τϯίʔυࣄ݅ • ஍ҬີணܕͷΞϧόΠτٻਓαΠτ • αΠτΛΫϩʔϦϯάதɺ ಥ೗Ϋϩʔϥʔ͕ྫ֎Λు͍ͯࢮ๢ • αΠτͷϨεϙϯεϔομΛ֬ೝ Content-Type:text/html;

    charset=%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89
  8. CUCC Ṗͷ63-Τϯίʔυࣄ݅ • ஍ҬີணܕͷΞϧόΠτٻਓαΠτ • αΠτΛΫϩʔϦϯάதɺ ಥ೗Ϋϩʔϥʔ͕ྫ֎Λు͍ͯࢮ๢ • αΠτͷϨεϙϯεϔομΛ֬ೝ Content-Type:text/html;

    charset=%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89
  9. CUCC Ṗͷ63-Τϯίʔυࣄ݅ • ஍ҬີணܕͷΞϧόΠτٻਓαΠτ • αΠτΛΫϩʔϦϯάதɺ ಥ೗Ϋϩʔϥʔ͕ྫ֎Λు͍ͯࢮ๢ • αΠτͷϨεϙϯεϔομΛ֬ೝ Content-Type:text/html;

    charset=%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89 ʊਓਓਓਓਓʊ ʼ ո͍͠ ʻ ʉ:?:?:?:ʉ
  10. CUCC Ṗͷ63-Τϯίʔυࣄ݅ Content-Type:text/html; charset=%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89 ڪΔڪΔ63-σίʔυ DIBSTFUจࣈίʔυ

  11. CUCC Ṗͷ63-Τϯίʔυࣄ݅ Content-Type:text/html; charset=%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89 ڪΔڪΔ63-σίʔυ DIBSTFUจࣈίʔυ

  12. CUCC Ṗͷ63-Τϯίʔυࣄ݅ Content-Type:text/html; charset=%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89 ʊਓਓਓਓਓਓਓʊ ʼ จࣈίʔυ ʻ ʉ:?:?:?:?:ʉ ڪΔڪΔ63-σίʔυ

    DIBSTFUจࣈίʔυ
  13. CUCC ͦͷଞʹ΋ • ᶃ΍᷂ͳͲͷจࣈԽ͚ରࡦ • จࣈίʔυࣗಈ൑ผ ˠ໿dϲ݄ؒɺจࣈίʔυͱ֨ಆ

  14. CUCC จࣈίʔυ

  15. CUCC จࣈίʔυʁ ʮจࣈίʔυʯ͕ԿΛࢦ͔͢͸จ຺ʹΑΔͨΊɺ ਖ਼͍͠ཧղͷͨΊʹ͸ԼهͷͭΛ۠ผ͢Δඞཁ͕͋Δɻ • ූ߸Խจࣈू߹ $PEFE$IBSBDUFS4FUʢ$$4ʣ "4$** +*49 6OJDPEF

    FUD • จࣈූ߸Խํࣜ $IBSBDUFS&ODPEJOH4DIFNFʢ$&4ʣ 4IJGU@+*4 &6$+1 65' FUD
  16. CUCC จࣈίʔυʁ ʮจࣈίʔυʯ͕ԿΛࢦ͔͢͸จ຺ʹΑΔͨΊɺ ਖ਼͍͠ཧղͷͨΊʹ͸ԼهͷͭΛ۠ผ͢Δඞཁ͕͋Δɻ • ූ߸Խจࣈू߹ $PEFE$IBSBDUFS4FUʢ$$4ʣ "4$** +*49 6OJDPEF

    FUD • จࣈූ߸Խํࣜ $IBSBDUFS&ODPEJOH4DIFNFʢ$&4ʣ 4IJGU@+*4 &6$+1 65' FUD
  17. CUCC จࣈίʔυʁ ʮจࣈίʔυʯ͕ԿΛࢦ͔͢͸จ຺ʹΑΔͨΊɺ ਖ਼͍͠ཧղͷͨΊʹ͸ԼهͷͭΛ۠ผ͢Δඞཁ͕͋Δɻ • ූ߸Խจࣈू߹ $PEFE$IBSBDUFS4FUʢ$$4ʣ "4$** +*49 6OJDPEF

    FUD • จࣈූ߸Խํࣜ $IBSBDUFS&ODPEJOH4DIFNFʢ$&4ʣ 4IJGU@+*4 &6$+1 65' FUD
  18. CUCC ৄ͘͠͸ IUUQTTQFBLFSEFDLDPNUPEPLSKJTLBSBQPSVXFO[JLPEPSVNFO

  19. CUCC 6OJDPEF&NPKJͱͦͷྺ࢙

  20. CUCC

  21. CUCC

  22. CUCC

  23. CUCC

  24. CUCC ถ ߹ऺࠃ੓෎ ೥݄೔ Ұൠڭॻԋઆ ࠃͷݱঢ়ʹ͍ͭͯͷେ౷ྖͷݟղΛड़΂ɺओཁͳ੓࣏՝୊Λઆ໌͢Δԋઆ IUUQTVQMPBEXJLJNFEJBPSHXJLJQFEJBDPNNPOTDDG1SFTJEFOU@0CBNB@EFMJWFST@UIF@4UBUF@PG@UIF@6OJPO@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ޓӡ༻ੑ֬อ͕໨త • ࢓༷͸653ʹ

  34. CUCC &NPKJऩ࿥·Ͱͷឯ༨ۂં ೥݄͔Βཌ೥݄ʹ͔͚ͯ 6OJDPEFͷϝʔϦϯάϦετͰܹ࿦͕ຄൃ

  35. CUCC &NPKJऩ࿥·Ͱͷឯ༨ۂં ೥݄͔Βཌ೥݄ʹ͔͚ͯ 6OJDPEFͷϝʔϦϯάϦετͰܹ࿦͕ຄൃ

  36. CUCC 3JDL.D(PXBO 6OJDPEFίϯιʔγΞϜ૑ઃ͔࣌Βͷϝϯόʔɻ౰࣌ͷઐ໳͸ݹ୅จࣈͷऩू IUUQTHSPVQTHPPHMFDPNGPSVNNTHFNPKJVOJDPEFO:QXB-5UHLO/RQX+L:9P+

  37. CUCC 3JDL.D(PXBO 6OJDPEFίϯιʔγΞϜ૑ઃ͔࣌Βͷϝϯόʔɻ౰࣌ͷઐ໳͸ݹ୅จࣈͷऩू IUUQTHSPVQTHPPHMFDPNGPSVNNTHFNPKJVOJDPEFO:QXB-5UHLO/RQX+L:9P+

  38. CUCC &NPKJͳΜͯͷ͸Ξϗ͍͘͞ྲྀߦͩͱࢥ͏ɻ 6OJDPEFʹؚΊΔͷ͕ྑ͍ͱ͸ࢥΘͳ͍ɻ 3JDL.D(PXBO 6OJDPEFίϯιʔγΞϜ૑ઃ͔࣌Βͷϝϯόʔɻ౰࣌ͷઐ໳͸ݹ୅จࣈͷऩू IUUQTHSPVQTHPPHMFDPNGPSVNNTHFNPKJVOJDPEFO:QXB-5UHLO/RQX+L:9P+

  39. CUCC &NPKJͳΜͯͷ͸Ξϗ͍͘͞ྲྀߦͩͱࢥ͏ɻ 6OJDPEFʹؚΊΔͷ͕ྑ͍ͱ͸ࢥΘͳ͍ɻ 3JDL.D(PXBO 6OJDPEFίϯιʔγΞϜ૑ઃ͔࣌Βͷϝϯόʔɻ౰࣌ͷઐ໳͸ݹ୅จࣈͷऩू .BSL%BWJT 6OJDPEFίϯιʔγΞϜཧࣄ௕ʹͯ͠&NPKJऩ࿥ͷఏҊऀ IUUQTHSPVQTHPPHMFDPNGPSVNNTHFNPKJVOJDPEFO:QXB-5UHLO/RQX+L:9P+

  40. CUCC &NPKJͳΜͯͷ͸Ξϗ͍͘͞ྲྀߦͩͱࢥ͏ɻ 6OJDPEFʹؚΊΔͷ͕ྑ͍ͱ͸ࢥΘͳ͍ɻ 3JDL.D(PXBO 6OJDPEFίϯιʔγΞϜ૑ઃ͔࣌Βͷϝϯόʔɻ౰࣌ͷઐ໳͸ݹ୅จࣈͷऩू .BSL%BWJT 6OJDPEFίϯιʔγΞϜཧࣄ௕ʹͯ͠&NPKJऩ࿥ͷఏҊऀ զʑ͸Կճ΋ٞ࿦ͨ͠͡Όͳ͍͔ɻ ͯ͞͸ډ຾ΓΛ͍ͯͨ͠ͳ IUUQTHSPVQTHPPHMFDPNGPSVNNTHFNPKJVOJDPEFO:QXB-5UHLO/RQX+L:9P+

  41. CUCC &NPKJͳΜͯͷ͸Ξϗ͍͘͞ྲྀߦͩͱࢥ͏ɻ 6OJDPEFʹؚΊΔͷ͕ྑ͍ͱ͸ࢥΘͳ͍ɻ 3JDL.D(PXBO 6OJDPEFίϯιʔγΞϜ૑ઃ͔࣌Βͷϝϯόʔɻ౰࣌ͷઐ໳͸ݹ୅จࣈͷऩू ݹ୅จࣈΑΓधཁ͕͋Δɻ զʑ͸Կճ΋ٞ࿦ͨ͠͡Όͳ͍͔ɻ ͯ͞͸ډ຾ΓΛ͍ͯͨ͠ͳ IUUQTHSPVQTHPPHMFDPNGPSVNNTHFNPKJVOJDPEFO:QXB-5UHLO/RQX+L:9P+ .BSL%BWJT

    6OJDPEFίϯιʔγΞϜཧࣄ௕ʹͯ͠&NPKJऩ࿥ͷఏҊऀ
  42. CUCC ͦͷଞʹ΋ • ʮֆจࣈͷొ࿥͸ɺύϯυϥͷശΛ։͚Δ͜ͱʹͳΔʯ • ʮ͖ΘΊͯڧ͘೔ຊͷจԽʹґଘ͓ͯ͠Γɺ೔ຊਓҎ֎ʹ ͸ཧղ͕೉͍͠ʯ • ʮ&NPKJ͸จষྗ͕ශऑͰ ײ৘ΛจࣈͰදݱͰ͖ͳ͍ਓͷͨΊͷ΋ͷͩʯ

  43. CUCC ͦͷଞʹ΋ • ʮֆจࣈͷొ࿥͸ɺύϯυϥͷശΛ։͚Δ͜ͱʹͳΔʯ • ʮ͖ΘΊͯڧ͘೔ຊͷจԽʹґଘ͓ͯ͠Γɺ೔ຊਓҎ֎ʹ ͸ཧղ͕೉͍͠ʯ • ʮ&NPKJ͸จষྗ͕ශऑͰ ײ৘ΛจࣈͰදݱͰ͖ͳ͍ਓͷͨΊͷ΋ͷͩʯ

  44. CUCC ͦͷଞʹ΋ • ʮֆจࣈͷొ࿥͸ɺύϯυϥͷശΛ։͚Δ͜ͱʹͳΔʯ • ʮ͖ΘΊͯڧ͘೔ຊͷจԽʹґଘ͓ͯ͠Γɺ೔ຊਓҎ֎ʹ ͸ཧղ͕೉͍͠ʯ • ʮ&NPKJ͸จষྗ͕ශऑͰ ײ৘ΛจࣈͰදݱͰ͖ͳ͍ਓͷͨΊͷ΋ͷͩʯ

  45. CUCC ͦͷଞʹ΋ • ʮֆจࣈͷొ࿥͸ɺύϯυϥͷശΛ։͚Δ͜ͱʹͳΔʯ • ʮ͖ΘΊͯڧ͘೔ຊͷจԽʹґଘ͓ͯ͠Γɺ೔ຊਓҎ֎ʹ ͸ཧղ͕೉͍͠ʯ • ʮ&NPKJ͸จষྗ͕ශऑͰ ײ৘ΛจࣈͰදݱͰ͖ͳ͍ਓͷͨΊͷ΋ͷͩʯ

  46. CUCC ͦͷଞʹ΋ • ʮֆจࣈͷొ࿥͸ɺύϯυϥͷശΛ։͚Δ͜ͱʹͳΔʯ • ʮ͖ΘΊͯڧ͘೔ຊͷจԽʹґଘ͓ͯ͠Γɺ೔ຊਓҎ֎ʹ ͸ཧղ͕೉͍͠ʯ • ʮ&NPKJ͸จষྗ͕ශऑͰ ײ৘ΛจࣈͰදݱͰ͖ͳ͍ਓͷͨΊͷ΋ͷͩʯ

  47. CUCC ࡢࠓͷ&NPKJࣄ৘

  48. CUCC ࡢࠓͷ&NPKJࣄ৘ • &NPKJ.PEJGJFST • ;8+4FRVFODF

  49. CUCC ʮͳΜͰࠇਓͷ&NPKJ͕ͳ͍ͷ ʯ ͖͔͚ͬ͸ϚΠϦʔɾαΠϥεͷπΠʔτ ͱݴΘΕ͍ͯΔ

  50. CUCC U+1F3FE

  51. CUCC U+1F3FE

  52. CUCC U+1F3FE

  53. CUCC &NPKJ.PEJGJFST • ೥ͷ6OJDPEFͰ௥Ճ • ίʔυϙΠϯτ͸6 ''#d6 ''' IUUQVOJDPEFPSHSFQPSUTUS&NPKJ@.PEJGJFST@5BCMF

  54. CUCC

  55. CUCC

  56. CUCC

  57. CUCC

  58. CUCC 6 %;&308*%5)+0*/&3 • ;8+;FSP8JEUI+PJOFS • ίʔυϙΠϯτ͸6 % • จࣈಉ࢜Λ͚ͬͭ͘Δʮ઀ணࡎʯͷΑ͏ͳ΋ͷ

    IUUQTXXXZPVUVCFDPNXBUDI WPO[%5Q3KLYT
  59. CUCC ;8+4FRVFODFT IUUQXXXVOJDPEFPSHFNPKJDIBSUTFNPKJ[XKTFRVFODFTIUNM

  60. CUCC ;8+4FRVFODFT IUUQXXXVOJDPEFPSHFNPKJDIBSUTFNPKJ[XKTFRVFODFTIUNM

  61. CUCC ;8+4FRVFODFT ;&308*%5)+0*/&3 IUUQXXXVOJDPEFPSHFNPKJDIBSUTFNPKJ[XKTFRVFODFTIUNM

  62. CUCC ;8+4FRVFODFT OFVUSBMͳGBNJMZ

  63. CUCC ;8+4FRVFODFT

  64. CUCC ;8+4FRVFODFT

  65. CUCC ;8+4FRVFODFT

  66. CUCC ;8+4FRVFODFT 6 %;&308*%5)+0*/&3

  67. CUCC ;8+4FRVFODFT 6 '."/

  68. CUCC ;8+4FRVFODFT 6 '80."/

  69. CUCC ;8+4FRVFODFT 6 '#0:

  70. CUCC ϓϩάϥϜ͔Βѻ͏

  71. CUCC 6OJDPEFͷߏ଄ ۠ɺ఺ɺ໘ɺ܈͔ΒͳΔ࣍ݩߏ଄ IUUQTXXXXPSH*OUFSOBUJPOBMBSUJDMFTEFGJOJUJPOTDIBSBDUFST

  72. CUCC &NPKJͱαϩήʔτϖΞ • 6OJDPEF&NPKJ͸#.1ʹؚ·Εͳ͍ • ֦ுྖҬΛදݱ͢ΔͨΊʹαϩήʔτϖΞΛ࢖༻ ˠ ѻ͍͕໘౗ʂ

  73. CUCC &NPKJΛ͍͍ײ͡ʹѻ͏ϥΠϒϥϦ • KTFNPKJ +BWB4DSJQU • FNPKJKBWB +BWB

  74. CUCC KTFNPKJ •  ͳͲͷΤΠϦΞεΛ6OJDPEFίʔυϙΠϯτʹม׵ • ϒϥ΢β͕ରԠ͍ͯ͠ͳ͍৔߹͸$44CBDLHSPVOEJNBHFͰ୅ସ

  75. CUCC KTFNPKJ •  ͳͲͷΤΠϦΞεΛ6OJDPEFίʔυϙΠϯτʹม׵ • ϒϥ΢β͕ରԠ͍ͯ͠ͳ͍৔߹͸$44CBDLHSPVOEJNBHFͰ୅ସ

  76. CUCC ΤΠϦΞε ˠ &NPKJ var converter = new EmojiConverter(); var

    str = "Hello:grinning:, Emoji World :wink:"; var result = converter.replace_colons(str); Console.log(result); // "Hello , Emoji World "
  77. CUCC FNPKJKBWB • ΤΠϦΞεͱ&NPKJͷ૬ޓม׵͕Մೳ • &NPKJ൑ఆ΍ϑΟϧλϦϯάɺ )5.-޲͚ΤϯςΟςΟࢀরʹม׵͢ΔػೳͳͲ΋ఏڙ

  78. CUCC FNPKJKBWB • ΤΠϦΞεͱ&NPKJͷ૬ޓม׵͕Մೳ • &NPKJ൑ఆ΍ϑΟϧλϦϯάɺ )5.-޲͚ΤϯςΟςΟࢀরʹม׵͢ΔػೳͳͲ΋ఏڙ

  79. CUCC FNPKJKBWB • ΤΠϦΞεͱ&NPKJͷ૬ޓม׵͕Մೳ • &NPKJ൑ఆ΍ϑΟϧλϦϯάɺ )5.-޲͚ΤϯςΟςΟࢀরʹม׵͢ΔػೳͳͲ΋ఏڙ

  80. CUCC ΤΠϦΞε ˠ &NPKJ String str = "Hello:grinning:, Emoji World

    :wink:"; String result = EmojiParser.parseToUnicode(str); System.out.println(result); // "Hello , Emoji World "
  81. CUCC ͓·͚&NPKJΛͬ͞ͱೖྗ .BDͳΒ $USM $PNNBOE εϖʔε

  82. CUCC )BWFB(PPE&NPKJ-JGF