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

[渋谷Java版] 楽しい文字コード入門 知っておきたいUnicode Emoji編

[渋谷Java版] 楽しい文字コード入門 知っておきたいUnicode Emoji編

第17回 渋谷Javaでの発表資料です。

9aba2147bb6e43333fcc42e2afc570f2?s=128

Shunsuke Tadokoro

October 03, 2016
Tweet

Transcript

  1. ौ୩KBWB ฏ੒ੜ·Εͷ จࣈίʔυೖ໳ ୈճ ौ୩+BWB !UPEPLS ஌͓͖͍ͬͯͨ 6OJDPEF&NPKJฤ ָ͍͠ʂ

  2. ौ୩KBWB ୭ͩ

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

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

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

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

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

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

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

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

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

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

  13. ौ୩KBWB จࣈίʔυ

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

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

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

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

  18. ौ୩KBWB 6OJDPEF&NPKJͱͦͷྺ࢙

  19. ौ୩KBWB

  20. ौ୩KBWB

  21. ौ୩KBWB

  22. ौ୩KBWB

  23. ौ୩KBWB ถ ߹ऺࠃ੓෎ ೥݄೔ Ұൠڭॻԋઆ ࠃͷݱঢ়ʹ͍ͭͯͷେ౷ྖͷݟղΛड़΂ɺओ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POUFOUVQMPBETFNPKJGSFRVFODZQOH ΈΜͳ&NPKJେ޷͖

  31. ौ୩KBWB IUUQXXXFNPKJUSBDLFSDPN

  32. ौ୩KBWB 6OJDPEF&NPKJ • 6OJDPEFʢ೥݄೔ʣʹॳऩ࿥ • ʮέʔλΠֆจࣈʯͷ૬ޓӡ༻ੑ֬อ͕໨త • ࢓༷͸653ʹ

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

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

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

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

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

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

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

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

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

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

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

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

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

  46. ौ୩KBWB ࡢࠓͷ&NPKJࣄ৘

  47. ौ୩KBWB ࡢࠓͷ&NPKJࣄ৘ • ϕϯμʔͷಠࣗදݱ • &NPKJ.PEJGJFST • ;8+4FRVFODF

  48. ौ୩KBWB ϕϯμʔͷಠࣗදݱ dJ04

  49. ौ୩KBWB ϕϯμʔͷಠࣗදݱ dJ04 J04

  50. ौ୩KBWB ൵ܶ ໌೔͸ެԂʹ࣌Ͷʂ Λ๨Εͳ͍ͰͶʙ

  51. ौ୩KBWB ൵ܶ ໌೔͸ެԂʹ࣌Ͷʂ Λ๨Εͳ͍ͰͶʙ ໌೔͸ެԂʹ࣌Ͷʂ Λ๨Εͳ͍ͰͶʙ

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

  53. ौ୩KBWB U+1F3FE

  54. ौ୩KBWB U+1F3FE

  55. ौ୩KBWB U+1F3FE

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

  57. ौ୩KBWB

  58. ौ୩KBWB

  59. ौ୩KBWB

  60. ौ୩KBWB

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

    IUUQTXXXZPVUVCFDPNXBUDI WPO[%5Q3KLYT
  62. ौ୩KBWB ;8+4FRVFODFT IUUQXXXVOJDPEFPSHFNPKJDIBSUTFNPKJ[XKTFRVFODFTIUNM

  63. ौ୩KBWB ;8+4FRVFODFT IUUQXXXVOJDPEFPSHFNPKJDIBSUTFNPKJ[XKTFRVFODFTIUNM

  64. ौ୩KBWB ;8+4FRVFODFT ;&308*%5)+0*/&3 IUUQXXXVOJDPEFPSHFNPKJDIBSUTFNPKJ[XKTFRVFODFTIUNM

  65. ौ୩KBWB ;8+4FRVFODFT OFVUSBMͳGBNJMZ

  66. ौ୩KBWB ;8+4FRVFODFT

  67. ौ୩KBWB ;8+4FRVFODFT

  68. ौ୩KBWB ;8+4FRVFODFT

  69. ौ୩KBWB ;8+4FRVFODFT 6 %;&308*%5)+0*/&3

  70. ौ୩KBWB ;8+4FRVFODFT 6 '."/

  71. ौ୩KBWB ;8+4FRVFODFT 6 '80."/

  72. ौ୩KBWB ;8+4FRVFODFT 6 '#0:

  73. ौ୩KBWB ϓϩάϥϜ͔Βѻ͏

  74. ौ୩KBWB 6OJDPEFͷߏ଄ ۠ɺ఺ɺ໘ɺ܈͔ΒͳΔ࣍ݩߏ଄ IUUQTXXXXPSH*OUFSOBUJPOBMBSUJDMFTEFGJOJUJPOTDIBSBDUFST

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

  76. ौ୩KBWB &NPKJΛ͍͍ײ͡ʹѻ͏ϥΠϒϥϦ • KTFNPKJ +BWB4DSJQU • FNPKJKBWB +BWB

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

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

  79. ौ୩KBWB ΤΠϦΞε ˠ &NPKJ var converter = new EmojiConverter(); var

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

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

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

  83. ौ୩KBWB ΤΠϦΞε ˠ &NPKJ String str = "Hello:grinning:, Emoji World

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

  85. ौ୩KBWB )BWFB(PPE&NPKJ-JGF