问题
Unicode's national flag Emojis are special compared to other Unicode characters and even to other Emoji characters.
All Emoji characters are outside the BMP in the "astral" plane of Unicode, which means that the Unicode codepoints are made up of a "surrogate pair", which is two JavaScript "characters" since JS predates UTF-16 when UCS-2 was in use.
But the flag Emoji actually require two codepoints, so four JavaScript "characters".
I don't know whether this is unique among Unicode characters or even among Emoji characters, but it is certainly not usual.
This means that rendering a Unicode flag emoji correctly depends on the OS's awareness of two-codepoint characters/glyphs, which has to be part of the font rendering code, not just the Unicode standard and the font definition.
The two characters making up a flag emoji are simply remappings of the two letters in the ISO country code. So an unsupported combination may result in a blank flag, or the two underlying special letters being rendered.
If my app wants to render only flags which will not fall back to something ugly, how can I know which flags, ie. which country codes, are available on the OS and OS version the app is running on?
Can I check this programatically or do the respective OSes publish lists of which they support with each new OS version? In the case of Android, it could even be that major phone manufacturers support more flags than their base Android version.
来源:https://stackoverflow.com/questions/46460528/how-to-know-which-unicode-emoji-flags-are-supported-per-ios-or-android-version