How to know which Unicode Emoji flags are supported per iOS or Android version?

守給你的承諾、 提交于 2019-12-23 19:52:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!