Created
April 28, 2021 02:05
-
-
Save hachi8833/268c4fa95cf44c1b44c2dac2e8663c6e to your computer and use it in GitHub Desktop.
Sequence of converting country code to flag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"FR".codepoints | |
#=> [70, 82] | |
70 + 127397 | |
#=> 127467 | |
127467.chr(Encoding::UTF_8) | |
#=> "🇫" | |
82 + 127397 | |
#=> 1274879 | |
127479.chr(Encoding::UTF_8) | |
#=> "🇷" | |
["🇫", "🇷"].join | |
#=> "🇫🇷" | |
"🇫🇷".codepoints # 確認 | |
#=> [127467, 127479] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment