Toying around with some code on the bus this morning, I came across an interesting fact about region flag emoji. Among the thousands of emoji that the Unicode standard defines, 270 of them represent region flags, each corresponding to a two-character region code: “us” means 🇺🇸, for example.
My curiosity was this: is there a way to programmatically generate the flag
emoji 🇺🇸 from the string
"us"? I was afraid that, like many other emoji, the
flags would each have a unique name — something like REGIONAL FLAG UNITED STATES
— and would require a lookup table to translate between the basic string
and the resulting emoji. Not so!