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

文字もじemojiよもやま話 / moji-moji-emoji

ima1zumi
November 05, 2020
170

文字もじemojiよもやま話 / moji-moji-emoji

ima1zumi

November 05, 2020
Tweet

Transcript

  1. " ".chars => [" ", " ", " ", "

    ", " ", " ", " "] 4
  2. ["1F468", "200D", "1F469", "200D", "1F466", "200D", "1F466"] " ".unpack("U*").map{_1.to_s(16).upcase} =>

    ["3042"] " ".unpack("U*").map{_1.to_s(16).upcase} => ["1F468", "200D", "1F469", "200D", "1F466", "200D", "1F466"] 8
  3. ⽂字コードから⽂字に変換 ⽂字コードから⽂字に変換 " ".unpack("U*").map{"U+#{_1.to_s(16).upcase}"} => ["U+1F468", "U+200D", "U+1F469", "U+200D", "U+1F466",

    "U+200D", "U+1F466"] [0x1F468].pack("U*") => " " [0x200D].pack("U*") => " " [0x1F469].pack("U*") => " " [0x1F466].pack("U*") => " " 10
  4. わかったこと わかったこと " " は [" ", " ", "

    ", " ", " ", " ", " "] でできてい た なぜこうなる? 11
  5. 7 ⽂字? " ".length => 7 " ".chars => ["

    ", " ", " ", " ", " ", " ", " "] 17